0
$\begingroup$

I have an assignment to train a model to classify text data, the brief for the assignment mentions that any for any learning model used I have to provide a reasoning for the similarity or distance metric used. What does this refer to?

My initial thought was that, for example, in logistic regression, the normalisation used would be L1 (Minkowski) or L2 (Euclidean). Would this be correct?

$\endgroup$
1
  • $\begingroup$ Why the downvote? $\endgroup$
    – THelper
    Dec 22 '17 at 8:23
0
$\begingroup$

The choice of the metric is somewhat dependent on how you are representing the text.

A common metric for vector space models would be cosine similarity.

Cosine similarity: K(X, Y) = < X, Y > / (||X||*||Y||)

Blockquote My initial thought was that, for example, in logistic regression, the normalisation used would be L1 (Manhattan) or L2 (Euclidean). Would this be correct?

In vector space models for text representation, the vectors are from a high dimension and sparse. When using L2 or L1 norm, there will be a term for every dimension which has a term in either vector. However, for consine similarity, since it is a dot product, there will only be a term when both elements in either vector is non-zero. The sparsity renders the consine similarity a better choice for such comparisons.

$\endgroup$

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.