私信  •  关注

Chiradip Bhattacharya

Chiradip Bhattacharya 最近创建的主题
Chiradip Bhattacharya 最近回复了
5 年前
回复了 Chiradip Bhattacharya 创建的主题 » python randomforest正在将rfe.support转换为列表

您可以使用to“.toList()”函数作为- list=rfe.support_u.tolist()

现在有了数组项的列表

然后使用for循环从创建的整个列表中筛选出真值,同时保持一个单独的列表作为真值的索引。

列表2=[]

对于范围(1,len(list))中的i:

if(int(list[i])==1):          # for the true values

    list2.append(i)           # the separate list with the index of true value items