Boruta Python 未选择功能

数据挖掘 特征选择
2022-03-07 01:31:16

我前一天在我的数据(nb features = 36)上使用 RandomForestClassifier 运行 Boruta,并得到了 17/36 的确认。现在我再次运行它,有 0/36 并在第 9 次迭代时停止。知道为什么会这样吗?

%%time
rfc = RandomForestClassifier(n_estimators=200, n_jobs=-1, class_weight= 'balanced_subsample' , max_depth=10)

boruta_selector = BorutaPy(rfc, n_estimators='auto', verbose=2, random_state=1)

boruta_selector_before.fit(X, y)

当前输出外观如下

Iteration:  1 / 100
Confirmed:  0
Tentative:  36
Rejected:   0
Iteration:  2 / 100
Confirmed:  0
Tentative:  36
Rejected:   0
Iteration:  3 / 100
Confirmed:  0
Tentative:  36
Rejected:   0
Iteration:  4 / 100
Confirmed:  0
Tentative:  36
Rejected:   0
Iteration:  5 / 100
Confirmed:  0
Tentative:  36
Rejected:   0
Iteration:  6 / 100
Confirmed:  0
Tentative:  36
Rejected:   0
Iteration:  7 / 100
Confirmed:  0
Tentative:  36
Rejected:   0
Iteration:  8 / 100
Confirmed:  0
Tentative:  0
Rejected:   36


BorutaPy finished running.

Iteration:  9 / 100
Confirmed:  0
Tentative:  0
Rejected:   36
CPU times: user 1.95 s, sys: 377 ms, total: 2.33 s
Wall time: 2.79 s
1个回答

我的错误来自于我的目标变量样本只有一个类。为了减少计算时间,我从主要数据中抽取了一个样本。