Preprocessing in scikit learn - single sample - Depreciation warning

前端 未结 6 2100
礼貌的吻别
礼貌的吻别 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条回答
  •  面向向阳花
    2020-11-27 06:02

    Just listen to what the warning is telling you:

    Reshape your data either X.reshape(-1, 1) if your data has a single feature/column and X.reshape(1, -1) if it contains a single sample.

    For your example type(if you have more than one feature/column):

    temp = temp.reshape(1,-1) 
    

    For one feature/column:

    temp = temp.reshape(-1,1)
    

提交回复
热议问题