【发布时间】:2020-02-05 01:51:24
【问题描述】:
我有一个多类分类问题,我正在尝试使用随机森林分类器。目标严重不平衡,具有以下分布-
1 34108
4 6748
5 2458
3 132
2 37
7 11
6 6
现在,我正在为 RandomForest 分类器使用“class_weight”参数,据我了解,与类关联的权重采用 {class_label: weight} 的形式
那么,以下是正确的方法吗:
rfc = RandomForestClassifier(n_estimators = 1000, class_weight = {1:0.784, 2: 0.00085, 3: 0.003, 4: 0.155, 5: 0.0566, 6: 0.00013, 7: 0.000252})
感谢您的帮助!
【问题讨论】:
-
谢谢,但没有解决多类重量问题
标签: machine-learning scikit-learn classification random-forest