I've been reading online and saw references to KNN to determine if an item is similar to other items. But it seems like KNN categorizes where an item belongs. I was thinking more in terms of given a movie

[director: "Henry Shingles", Starring-Actor: "Will Smith", Release-Date: "Jan 1828"]

I could find movies with similar attributes.

For example, the algorithm might return

[director: "Henry Shingles", Starring-Actor: "Will Smith", Release-Date: "Dec 1977"]

instead of

[director: "Henry Shingles", Starring-Actor: "Poop Macey", Release-Date: "Dec 1977"]

Because the former has two attributes "Henry Shingles" and "Will Smith" that matches.

Would Cosine Similarity work in my case?


KNN can be used for classification or regression. Categorizing would be classification, and it seems that you need regression.

Defining a right metric for KNN is an important part.

With the data that you provided, I don't think cosine similarity will work well. Usually, you would create a binary vector of all the features for an item, and the compare using cosine similarity. However, in your case Date is given as "Dec 1977", that means as that "Nov 1977" will be different feature, and the only way for similarity on Date to show up would if the movies were released in the same month, and you would be losing information. You probably would need to write something custom for dates.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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