Jason
Jason

Reputation: 41

Can I use SVM for similarity matching

Suppose I have two feature vectors extracted from two samples using some methods and I want to compare these two feature vectors to predict whether they are coming from the same class or different classes. Can I use SVM for such purpose? As far as I understand, SVM is used to accept one input (now I have two) and predict whether it belongs to one specific class or not. I don't know how to use it for similarity measurement.

Simple methods like cosine distance or Euclidean distance have been tested and the performance was bad. So I just want to try some learning methods like SVM, NN or others if you have any suggestion. Thx!

Upvotes: 3

Views: 1584

Answers (1)

Raff.Edward
Raff.Edward

Reputation: 6534

Yes, they can - you are describing a new classification problem. Your input is simply now twice as large as before (the two feature vectors concatenated together) and the class labels are "same" and "not same".

ie: your feature vectors may have been [a, b] and [x, y] for two different inputs, and now you have one feature vector [a, b, x, y]. Note you may also want to train on pairs like [x, y, a, b] since either way should produce the correct classification.

You could also look at different ways of making your features, there are a number of options. There are also other ways of phrasing the problem.

Upvotes: 5

Related Questions