# Similarity based document classification compared to the user profile ratings

I need to understand a distinction to check if I understood a document classification problem right.

Given a training set of documents with ratings, that a user has given, let's say rating $r_{k} \in \{"like", "not \ like"\}$ of documents $d_{k}$ with the features $f_{i} \in d_{k}$ (words, with their frequencies).

Do I now create two vectors $Training_{like} = <..., <f_{i}, |f_{i}|>, ...>$ and $Training_{not\ like} = < ... >$ in a user's profile and add up the $f_{i}$ term frequencies of all documents according to $r_{k}$ in two giant vectors and compare then a new document $d_{j}$ with both vectors $Training_{like}$ and $Training_{not\ like}$:

$similarity(Training_{like}, d_{j})$ and $similarity(Training_{not \ like}, d_{j})$ and then take the closer vector or do I need to store and compare all single $d_{k}$ in the Training sets and compare each documents individually in each class with $d_{j}$ ?

The similarity function is:

$sim(d_{i}, d_{j}) = \frac{\sum\limits_{k} w_{ki} \cdot w_{kj}}{ \sqrt{\sum\limits_{k} w_{ki}^2} \cdot \sqrt{\sum\limits_{k} w_{kj}^2} }$, with $w_{k,i} \in d_{i}$ and $w_{k,j} \in d_{j}$

Whereby the two documents $d_{i}, d_{j}$ are, instead user profile and document features:

$sim(Training_{like}, d_{j})$ and $sim(Training_{not\ like}, d_{j})$

• Your method might give certain level of accuracy. For the alternative proposal, what operators do you wish to use to aggregate the results of comparing to all single $d_k$? If the operators are associative ($+$ and $*$) for example, then you can always form some giant vectors before hand. No need to do individually on each $d_k$ for every single request $d_j$ – InformedA Nov 21 '14 at 22:41
• If I would aggregate them, then I would most likely add up all logs or something like that. When I have two training sets, then I have basically a $|vocabulary_{k}|$-dimensional word space of all documents in $Training_{k}$. I'm clear that this yields to some accuracy, but I hope this is not wrong, from information retrieval perspective, which could have a much more obvious solution, I thought. – Sam Nov 22 '14 at 0:05
• I think I can help you a bit if you tell me the exact formula you use for measuring $similarity$ between two documents. Also, one will need to look at how you aggregate the results of comparison between each $d_k$ and $d_j$. After that, I can probably tell if the two are different or the same. As I mention in the comment. If you only use operators that are associate, then you can re-order which then means the two methods you proposed are the same. If you use more than one operators, then commutative will also matter. Please let us know what formula you use. – InformedA Nov 22 '14 at 21:49