text_plain_output_1.png
from sklearn.tree import DecisionTreeRegressor

import pandas as pd

import pandas as pd
main_file_path = '../input/train.csv'
data = pd.read_csv(main_file_path)
home_sale_price = data.SalePrice
column_interest = ['BsmtFinSF1', 'SalePrice']
two_column_data = data[column_interest]

y = data.SalePrice
Cost_predictors = ['LotArea', 'YearBuilt', '1stFlrSF', '2ndFlrSF', 'FullBath', 'BedroomAbvGr', 'TotRmsAbvGrd']
X = data[Cost_predictors]
from sklearn.tree import DecisionTreeRegressor
price_model = DecisionTreeRegressor()
price_model.fit(X, y)
print('making prediction for following houses')
print(X.head())
print('The predictions are: ')
print(price_model.predict(X.head()))