admin管理员组

文章数量:1650776

直接上代码!

# 在训练集上训练一个监督学习模型
model = AdaBoostClassifier(base_estimator=DecisionTreeClassifier(max_depth=3),n_estimators=8)
model.fit(X_train,y_train)

# 提取特征重要性
importances = model.feature_importances_

# 绘图
vs.feature_plot(importances, X_train, y_train)

AdaBoost,随机森林等模型具有’feature_importance_’ 属性,主要是对特征的重要性排序。

本文标签: 重要性特征