π Quick StartΒΆ
β Feature SelectionΒΆ
An example to quickly run a Feature Selection pipeline with embedded Cross-Validation and Feature-Importance visualization:
from slickml.feautre_selection import XGBoostFeatureSelector
xfs = XGBoostFeatureSelector()
xfs.fit(X, y)
xfs.plot_cv_results()
xfs.plot_frequency()
β Hyper-parameter TuningΒΆ
An example to quickly find the tuned hyper-parameter with Bayesian Optimization:
from slickml.optimization import XGBoostBayesianOptimizer
xbo = XGBoostBayesianOptimizer()
xbo.fit(X_train, y_train)
best_params = xbo.get_best_params()
best_params
{"colsample_bytree": 0.8213916662259918,
"gamma": 1.0,
"learning_rate": 0.23148232373451072,
"max_depth": 4,
"min_child_weight": 5.632602921054691,
"reg_alpha": 1.0,
"reg_lambda": 0.39468801734425263,
"subsample": 1.0
}
β
Classification via XGBoost
ΒΆ
An example to quickly train/validate a XGBoostCVClassifier
with Cross-Validation, Feature-Importance, and Shap visualizations:
from slickml.classification import XGBoostCVClassifier
clf = XGBoostCVClassifier(params=best_params)
clf.fit(X_train, y_train)
y_pred_proba = clf.predict_proba(X_test)
clf.plot_cv_results()
clf.plot_feature_importance()
clf.plot_shap_summary(plot_type="violin")
clf.plot_shap_summary(plot_type="layered_violin", layered_violin_max_num_bins=5)
clf.plot_shap_waterfall()
β
Classification via GLMNet
ΒΆ
An example to train/validate a GLMNetCVClassifier
with Cross-Validation and Coefficients visualizations:
from slickml.classification import GLMNetCVClassifier
clf = GLMNetCVClassifier(alpha=0.3, n_splits=4, metric="auc")
clf.fit(X_train, y_train)
y_pred_proba = clf.predict_proba(X_test)
clf.plot_cv_results()
clf.plot_coeff_path()
β Classification MetricsΒΆ
An example to quickly visualize the binary classification metrics based on multiple thresholds:
from slickml.metrics import BinaryClassificationMetrics
clf_metrics = BinaryClassificationMetrics(y_test, y_pred_proba)
clf_metrics.plot()
β Regression MetricsΒΆ
An example to quickly visualize some regression metrics:
from slickml.metrics import RegressionMetrics
reg_metrics = RegressionMetrics(y_test, y_pred)
reg_metrics.plot()