I've been working to predict samples with the sklearn implementation of KNN.
So far i've been training my classifier with a sample of my dataset, and then testing it with another distinct sample of the dataset and appearing to see an accuracy of around 98%.
However, when attempting to predict a single sample the predictions are all over the place even when using samples the model has been trained on. The only guess i have is that there is a problem when preprocessing the entire dataset with preprocessing.scale versus preprocessing a single sample with the same technique.
I've read Preprocessing in scikit learn - single sample - Depreciation warning and am wondering if there is a correct way to preprocess a single sample.
EDIT: Code for preprocessing shown below For the whole dataset:
self.trainData = preprocessing.scale(self.trainData)
For a single sample, where log is of the same form as samples in traindata.
log = preprocessing.scale(log)