Predicting missing values with scikit-learn's Imputer module

后端 未结 3 1661
情话喂你
情话喂你 2021-02-05 09:48

I am writing a very basic program to predict missing values in a dataset using scikit-learn\'s Imputer class.

I have made a NumPy array, created an Imp

3条回答
  •  半阙折子戏
    2021-02-05 10:08

    Per the documentation, sklearn.preprocessing.Imputer.fit_transform returns a new array, it doesn't alter the argument array. The minimal fix is therefore:

    X = imp.fit_transform(X)
    

提交回复
热议问题