Model selection: ensemble models

Practicing Machine Learning Interview Questions in Python

Lisa Stuart

Data Scientist

Bootstrapping

Bootstrapping

1 https://medium.com/@rrfd/boosting-bagging-and-stacking-ensemble-methods-with-sklearn-and-mlens-a455c0c982de
Practicing Machine Learning Interview Questions in Python

Random forest

Forest

1 https://www.sca.com/en/about-us/our-forest/
Practicing Machine Learning Interview Questions in Python

Gradient Boosting

Gradient boosting

1 https://blog.bigml.com/2017/03/14/introduction-to-boosted-trees/
Practicing Machine Learning Interview Questions in Python

RF vs GB

parameter Random Forest Gradient Boosting
n_estimators 10 100
criterion gini (or entropy) friedman_mse
max_depth None 3
learning_rate N/A 0.1
1 https://scikit-learn.org/stable/modules/classes.html#module-sklearn.ensemble
Practicing Machine Learning Interview Questions in Python

Functions

Function returns
sklearn.ensemble.RandomForestClassifier Random Forest
sklearn.ensemble.GradientBoostingClassifier Gradient Boosted Model
sklearn.metrics.accuracy_score trained model accuracy
sklearn.metrics.confusion_matrix(y_test,y_pred) confusion matrix
sklearn.metrics.precision_score(y_test,y_pred) precision
sklearn.metrics.recall_score(y_test,y_pred) recall
sklearn.metrics.f1_score(y_test,y_pred) f1 score
Practicing Machine Learning Interview Questions in Python

Let's practice!

Practicing Machine Learning Interview Questions in Python

Preparing Video For Download...