我想交叉验证随机森林模型。我做到了这一点:但我不知道如何适应它。
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)
我知道要用交叉验证来填充模型
val.fit(X, y)
你不需要fit
,你应该在scores
有5倍的val