text_html_output_1.png
from sklearn.metrics import mean_absolute_error

from sklearn.model_selection import train_test_split

from sklearn.tree import DecisionTreeRegressor

import pandas as pd

import pandas as pd
main_file_path = '../input/train.csv'
df = pd.read_csv(main_file_path)

price = df.SalePrice

columns_of_interest = ['HouseStyle', 'SaleCondition']
two_columns_of_data = df[columns_of_interest]

y = price

columns_of_interest = ['LotArea', 'YearBuilt', '1stFlrSF', '2ndFlrSF', 'FullBath', 'BedroomAbvGr', 'TotRmsAbvGrd']
X = df[columns_of_interest]

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

from sklearn.metrics import mean_absolute_error
predicted_home_prices = myModel.predict(X)
mean_absolute_error(y, predicted_home_prices)

from sklearn.model_selection import train_test_split
train_X, val_X, train_y, val_y = train_test_split(X, y, random_state=0)
myModel = DecisionTreeRegressor()
myModel.fit(train_X, train_y)
val_predictions = myModel.predict(val_X)
print(mean_absolute_error(val_y, val_predictions))