Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

random forest cross validation python

from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score
import numpy as np

clf = RandomForestClassifier() #Initialize with whatever parameters you want to

# 10-Fold Cross validation
print np.mean(cross_val_score(clf, X_train, y_train, cv=10))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #random #forest #cross #validation #python
ADD COMMENT
Topic
Name
8+1 =