January 2020
Beginner to intermediate
432 pages
11h 24m
English
Execute the following steps to train the advanced classifiers.
from sklearn.ensemble import (RandomForestClassifier, GradientBoostingClassifier)from xgboost.sklearn import XGBClassifierfrom lightgbm import LGBMClassifier
rf = RandomForestClassifier(random_state=42) rf_pipeline = Pipeline(steps=[('preprocessor', preprocessor), ('classifier', rf) ])rf_pipeline.fit(X_train, y_train)rf_perf = performance_evaluation_report(rf_pipeline, X_test, y_test, labels=LABELS, show_plot=True, show_pr_curve=True)
The performance of the Random Forest can be summarized by the following plot:
gbt = GradientBoostingClassifier ...
Read now
Unlock full access