0

I was performing an imputation of missing values by KNN with this code:

1) data[missing] = KNN(k = 3, verbose = False).fit_transform(data[missing])

However, I saw some tutorials (e.g. Chris Albon - Machine Learning With Python Cookbook p. 78) that used the method .complete();

2) features_knn_imputed = KNN(k=5, verbose=0).complete(X_train[true_nums])

I was wondering if 2) is deprecated code or if my implementation of KNN for imputing in 1) is incorrect?

00schneider
  • 698
  • 9
  • 21

1 Answers1

1

Yes, .complete is deprecated. Use .fit_transform just like sklearn.

Check the usage here: https://pypi.org/project/fancyimpute/0.5.5/

Ann Kilzer
  • 1,266
  • 3
  • 16
  • 39
Sea
  • 46
  • 1
  • 3