July 2017
Beginner to intermediate
442 pages
10h 8m
English
Grid search has been performed by changing various hyperparameters with the following settings. However, readers are encouraged to try other parameters to explore further in this space.
Import Pipeline as follows:
>>> from sklearn.pipeline import Pipeline>>> from sklearn.model_selection import train_test_split,GridSearchCV
The Pipeline function creates the combinations which will be applied one by one sequentially to determine the best possible combination:
>>> pipeline = Pipeline([ ('clf',RandomForestClassifier(criterion='gini'))])>>> parameters = { ... 'clf__n_estimators':(1000,2000,3000), ...