出错原因:模型使用的不是线性核函数,而coef_属性只在使用线性核函数时可用。

修改方法:使用线性核函数重新训练模型,或者使用其他可用的特征重要性评估方法。

AttributeError Traceback most recent call lastCell In67 line 2 1 # 获取特征权重---- 2 coef = modelcoef_0 4 # 绘制特征重要性图 5 pltbarrangelencoef coefFile ~anaconda3libsit

原文地址: https://www.cveoy.top/t/topic/hot1 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录