亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

顯示的“eli5.show_weights”標準差與

顯示的“eli5.show_weights”標準差與

汪汪一只貓 2022-08-16 10:46:20
該對象具有一些不錯的屬性,例如 和 。PermutationImportancefeature_importances_feature_importances_std_為了在HTML樣式中可視化此屬性,我使用了函數。但是,我注意到顯示的標準偏差與 中的值不一致。eli5.show_weightsfeature_importances_std_更具體地說,我可以看到顯示的HTML值等于feature_importances_std_ * 2。為什么?法典:from sklearn import datasetsimport eli5from eli5.sklearn import PermutationImportancefrom sklearn.svm import SVC, SVR# import some data to play withiris = datasets.load_iris()X = iris.data[:, :2]  # we only take the first two features.y = iris.targetclf = SVC()perms = PermutationImportance(clf, n_iter=1000, cv=10, random_state=0).fit(X, y)print(perms.feature_importances_)# this is the actual SDprint(perms.feature_importances_std_)# These are the displayed valuesprint(perms.feature_importances_std_* 2)[0.39527333 0.17178   ] # the actual mean[0.13927548 0.11061278] # the actual SD[0.27855095 0.22122556] # the displayed values by `show_weights()`eli5.show_weights(perms)我們可以看到,不同的標準差是雙重的,即。2 * perms.feature_importances_std_這可能是一個錯誤嗎?
查看完整描述

1 回答

?
www說

TA貢獻1775條經驗 獲得超8個贊

找到:
它在模板中生成了以下頁面的功能重要性html表*2

https://github.com/TeamHG-Memex/eli5/blob/63e99182dc682bbf225355c80a24807396a747b6/eli5/templates/feature_importances.html

        {% if not fw.std is none %}
            ± {{ "%0.4f"|format(2 * fw.std) }}
        {% endif %}

它顯然是用手放的


查看完整回答
反對 回復 2022-08-16
  • 1 回答
  • 0 關注
  • 94 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號