Cosine similarity or logistic regression for spam filtering I'm trying to choose an algorithm for filtering spam.
I found two options:


Create word dictionary for spam and not spam data.
Calculate average TF-IDF for each word and use cosine similarity for filtering.
Or use word dictionary for training logistic regression model.


Could you suggest what fit the best for my goal. 
Maybe I should use some another algorithm.
Use logistic regression which allows the weights to be learnt. By using cosine similarity you are forcing the weights to be the same for all features (assuming that you normalize the features first). This is putting unnecessary restrictions on the model.