Search
 
SCRIPT & CODE EXAMPLE
 

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))
Comment

PREVIOUS NEXT
Code Example
Python :: freq count in python 
Python :: where my python modules 
Python :: series to dataframe with column names 
Python :: python read mp3 livestream 
Python :: python datetime last day of month 
Python :: python nmap 
Python :: how to execute a cmd command in python 
Python :: set the root directory when starting jupyter notebooks 
Python :: python square root 
Python :: pandas series sort 
Python :: python merge csv files in same folder 
Python :: python udp receive 
Python :: amazon cli on commadline 
Python :: plot bounds python 
Python :: python pop up box 
Python :: telethon invite to group 
Python :: shift axis in python 
Python :: how to convert input to uppercase in python 
Python :: how to clear a pickle file 
Python :: stringbuilder python 
Python :: Installing python module from within code 
Python :: cprofile usage python 
Python :: access-control-allow-origin django 
Python :: python fizzbuzz 
Python :: how to remove empty elements in a list python 
Python :: how to sort values in python from dictionary to list 
Python :: pillow read from ndarray 
Python :: limpiar consola en python 
Python :: plt.savefig 
Python :: run git pull from python script 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =