1
$\begingroup$

I am dealing with sentiment results of web articles. Sentiment is represented with two int values, +ve and -ve.

For given article "xyz" I am getting different sentiments while testing at different time period. Each result has +Ve and -ve value. I represent them using 2-D Graph on x-y axis.

My purpose is to get sentiment result with higher density. Is KNN also is suitable for this kind of scenario? Or any othe approach if someone can suggest ..

$\endgroup$

1 Answer 1

1
$\begingroup$

It's a perfectly reasonable approach to use KNN on the non-labels (e.g, not +Ve and -ve). This would involve finding the k-nearest neighbors and then have them 'vote' on the label of the test instance by taking the majority.

Consider the contrived example below. Say you are attempting to predict whether the orange instance has '+' or '-' label, and you have chosen $k=5$. You would find the 5 closest training instances, as indicated by what is enclosed by the dashed line. You would then count the number of instances with a '+' and '-' and use the majority as the classification. In this case you would classify the orange dot as '+'. Note you can also weight each vote based on distance.

enter image description here

$\endgroup$
2
  • $\begingroup$ Can you please give any reference for this, for above mentioned case I could not get appropriate help ... $\endgroup$
    – user123
    Commented Feb 11, 2014 at 4:35
  • $\begingroup$ do you mean getting neighbors for all points and selecting point which is votes highest times? $\endgroup$
    – user123
    Commented Feb 15, 2014 at 6:46

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.