0
votes

I want to cross validate a random forest model. I did this: but i didn't know how to fit it.

classifier= RandomForestClassifier(n_estimators=100, random_state=0)    
from sklearn.model_selection import cross_val_score  
val = cross_val_score(estimator=classifier, X=X_train, y=y_train, cv=5)

Know to fil the model with cross validation shall i do

 val.fit(X, y)
1

1 Answers

0
votes

You don't need to fit, you should have the scores of the 5 folds in val