模型选择:集成模型

用 Python 练习机器学习面试题

Lisa Stuart

Data Scientist

自助采样(Bootstrapping)

自助采样

1 https://medium.com/@rrfd/boosting-bagging-and-stacking-ensemble-methods-with-sklearn-and-mlens-a455c0c982de
用 Python 练习机器学习面试题

随机森林

森林

1 https://www.sca.com/en/about-us/our-forest/
用 Python 练习机器学习面试题

梯度提升

梯度提升

1 https://blog.bigml.com/2017/03/14/introduction-to-boosted-trees/
用 Python 练习机器学习面试题

随机森林 vs 梯度提升

参数 随机森林 梯度提升
n_estimators 10 100
criterion gini(或entropy friedman_mse
max_depth None 3
learning_rate 不适用 0.1
1 https://scikit-learn.org/stable/modules/classes.html#module-sklearn.ensemble
用 Python 练习机器学习面试题

函数

函数 返回
sklearn.ensemble.RandomForestClassifier 随机森林
sklearn.ensemble.GradientBoostingClassifier 梯度提升模型
sklearn.metrics.accuracy_score 训练后模型准确率
sklearn.metrics.confusion_matrix(y_test,y_pred) 混淆矩阵
sklearn.metrics.precision_score(y_test,y_pred) 精确率
sklearn.metrics.recall_score(y_test,y_pred) 召回率
sklearn.metrics.f1_score(y_test,y_pred) F1 分数
用 Python 练习机器学习面试题

开始练习!

用 Python 练习机器学习面试题

Preparing Video For Download...