Chapter 18 : End to End Project - Bikes Assessment - Basic - Train and Analyze the Models - Preparing to Train the Models


#1

from sklearn.model_selection import cross_validate,cross_val_predict
from sklearn import linear_model
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import RandomForestRegressor
from xgboost import XGBRegressor

trainingCols=train_set.drop(columns=‘cnt’,axis=1)
trainingLabels=train_set[‘cnt’]

Error “cross_val_score not imported”


#2

I think you need to import cross_val_score from sklearn.model_selection


#3

I have already imported both the functions together in below line
“from sklearn.model_selection import cross_validate,cross_val_predict”

Please note the code is executing correctly.


#4

It is checking for a function cross_val_score.


#5

Got it working.

Thanks