Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
750 B
5
Indexable
Never
import pandas as pd
from sklearn.metrics import mean_squared_error
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeRegressor
from sklearn.linear_model import LinearRegression
# import model you picked from its module

df = pd.read_csv('/datasets/train_data_us.csv')

# initialize variables:
features = df.drop(['last_price'],axis=1)
target = df['last_price']/100000

final_model = LinearRegression()# initialize constructor for model that had the best RMSE value 
final_model.fit(features,target) # train model on training set

print("\nRMSE of the final model on the training set:", mean_squared_error(target, final_model.predict(features), squared=False))
Leave a Comment