5
ความสำคัญของคุณลักษณะกับป่าสุ่มเรียนรู้ scikit แสดงค่าเบี่ยงเบนมาตรฐานที่สูงมาก
ฉันกำลังใช้ตัวจำแนกประเภทฟอเรสต์แบบสุ่มของ scikitและฉันต้องการพล็อตความสำคัญของคุณลักษณะเช่นในตัวอย่างนี้ อย่างไรก็ตามผลลัพธ์ของฉันแตกต่างอย่างสิ้นเชิงในแง่ที่ความสำคัญของความเบี่ยงเบนมาตรฐานสำคัญมักจะใหญ่กว่าความสำคัญของคุณสมบัติ (ดูรูปที่แนบมา) เป็นไปได้ไหมที่จะมีพฤติกรรมเช่นนี้หรือฉันทำผิดพลาดบางอย่างเมื่อวางแผนมัน? รหัสของฉันคือ: import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn.ensemble import RandomForestClassifier clf = RandomForestClassifier() clf.fit(predictors.values, outcome.values.ravel()) importance = clf.feature_importances_ importance = pd.DataFrame(importance, index=predictors.columns, columns=["Importance"]) importance["Std"] = np.std([tree.feature_importances_ for tree in clf.estimators_], axis=0) x = range(importance.shape[0]) y = importance.ix[:, 0] …