使用隨機邏輯迴歸模型進行特徵篩選,使用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)就好了。