Random_Logistic_regression中get_support()方法

使用隨機邏輯迴歸模型進行特徵篩選,使用get_support方法獲取結果時出現以下錯誤:

IndexError: boolean index did not match indexed array along dimension 0; dimension is 9 but corresponding boolean dimension is 8

解決辦法:

get_support(indices=False)indices默認是False,返回一個類型是boolean的數組;indices爲True,返回一個整型數組,

所以解決辦法就是把參數改變。默認的是False,改爲get_support(indices=True)就好了。
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章