1

I have a program that works flawlessly on known data sets such as the Breast Cancer Wisconsin data. I have created a novel data set with current air pressure in 100 cities and the future movement of a stock price. So about 100 dimensions plus the classifier which is -1 or 1. There are about 350 instances of data. The algorithm is showing about an 80% accuracy.

My problem is that when I input old data to make a prediction, it is only predicting 1, never -1. This is even the case when the training data contained the -1 classifier. Any ideas are greatly appreciated!

1 Answer 1

2

KNN takes a vote on the n nearest neighbours. So with n=5 you need 3 neighbours to vote -1. This may be never if -1 is a rare occurrence and the -1s are not clustered together. Suggest you try other algorithms as well.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, that makes sense :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.