Preprocessing in scikit learn - single sample - Depreciation warning

前端 未结 6 2093
礼貌的吻别
礼貌的吻别 2020-11-27 05:01

On a fresh installation of Anaconda under Ubuntu... I am preprocessing my data in various ways prior to a classification task using Scikit-Learn.

from sklear         


        
6条回答
  •  猫巷女王i
    2020-11-27 06:01

    I faced the same issue and got the same deprecation warning. I was using a numpy array of [23, 276] when I got the message. I tried reshaping it as per the warning and end up in nowhere. Then I select each row from the numpy array (as I was iterating over it anyway) and assigned it to a list variable. It worked then without any warning.

    array = []
    array.append(temp[0])
    

    Then you can use the python list object (here 'array') as an input to sk-learn functions. Not the most efficient solution, but worked for me.

提交回复
热议问题