Python随机森林坏概率分布

2024-04-20 01:56:20 发布

您现在位置:Python中文网/ 问答频道 /正文

使用Scikit随机森林分类器。我试图预测一个双星目标,并得到概率。在

from sklearn.ensemble import RandomForestClassifier
X_train, X_test, y_train, y_test = train_test_split(df, y, test_size=0.25, random_state=42)
rf = RandomForestClassifier(n_estimators=100, random_state=42,class_weight=None, max_features="auto",
                            bootstrap="False", criterion='entropy')
rf.fit(X_train, y_train)   
preds = rf.predict_proba(X_test)

问题是概率分布有点奇怪。 enter image description here

如你所见,0.4的垃圾箱有点奇怪。我可以理解短暂的波动,但这是下降到那个垃圾桶的数量急剧减少。 考虑到测试装置在10M左右

^{pr2}$

Python Random Forest怎么能在prob分布中造成这样的漏洞?对此有什么建议或想法吗?在

Ps:带箱打印=50 enter image description here


Tags: fromtestimport目标分类器森林trainrandom