November 2017
Intermediate to advanced
1035 pages
11h 31m
English
We've looked at the using cross validation iterators that scikit-learn comes with, but we can also use a helper function to perform cross validation for use automatically. This is similar to how other objects in scikit-learn are wrapped by helper functions, pipeline for instance.
First, we'll need to create a sample classifier; this can really be anything, a decision tree, a random forest, whatever. For us, it'll be a random forest. We'll then create a dataset and use the cross validation functions.
First import the ensemble module and we'll get started:
>>> from sklearn import ensemble >>> rf = ensemble.RandomForestRegressor(max_features='auto')
Okay, so now, let's create some regression data: ...
Read now
Unlock full access