Untitled
unknown
plain_text
21 days ago
713 B
0
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'] final_model = # initialize constructor for model that had the best RMSE value final_model.fit(...) # 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