Question about reshaping array size for KNN Classifiers
I keep trying to run a new set of data through my KNN Classifier but would recieve the message:
ValueError: query data dimension must match training data dimension
It then used:
x_new = pd.read_csv('NewFeaturePractice.csv' , names = attributes)
x_new = x_new.values.reshape(52,84)
(which is the dimensions of the training data) but would then receive:
ValueError: cannot reshape array of size 672 into shape (52,84)
The second data set doesn't have the same amount of rows as the first meaning that even if I tried reshaping the array I would have several empty spaces. How can I run the code so that no matter the size of my new data set, I can still get results?
Topic k-nn classifier python
Category Data Science