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_train = pd.read_csv(main_file_path)

y = data_train.SalePrice

predicators = ['YearBuilt', 'YrSold', 'TotalBsmtSF', 'LotShape', 'SaleType', 'SaleCondition']
one_hot_encoded_training_predictors = pd.get_dummies(predicators)
one_hot_encoded_training_predictors

X = data_train[predicators]
X

from sklearn.tree import DecisionTreeRegressor
housing_model = DecisionTreeRegressor()
housing_model.fit(X, y)

print(' making predictions for the following 5 houses:')
print(X.head())
print('The prediction are')
print(housing_model.predict(X.head()))