r/MachineLearning • • Aug 02 '09

[deleted by user]

[removed]

20 Upvotes

18 comments sorted by

View all comments

4

u/ogrisel Aug 02 '09

Build a weekly or monthly updated corpus of existing reddit entries along with the tripped html page targeted by the url and use the subreddit category as label (a farm of python crawlers with the HTML parser of lxml can be quite handy for that task).

Then for each entry extract sparse features vectors such as the log-TF-IDF, bi-grams, ... then train a classifier model on that data (linear support vector machines with an online learning implementation would do for instance).

The trending fast online classifier implementation is the Vowpal Wabbit by the Yahoo Research machine learning team: http://github.com/JohnLangford/vowpal_wabbit/

3

u/AngledLuffa Aug 02 '09

It might not be necessary to make a SVM. I predict normalizing vector lengths and using k-nearest neighbors or just the closest average subreddit will work fine. This would also help get around the problem of low training data for new or infrequently used reddits.

We could even use similar methods to cluster subreddits. There may be obvious ways to divide large subreddits into two smaller subreddits.

3

u/semanticprecision Aug 02 '09

I think that bigrams may be computationally expensive, relative to the minimal advances in accuracy they'd provide. This hypothesis is based on my view that subreddits are highly stratified, and many are well-defined in terms of one or two proper nouns. For example, my subreddits could be easily decided on the basis of the terms Haskell, Python, tomato, apple, Contador, Armstrong, and maybe recession.

I'm extrapolating a bit from my own usage patterns, but I don't know that that's inaccurate. I wouldn't argue against trying n-grams, but I think they wouldn't buy that much in terms of additional insight; then again, they might help solve the Christianity versus Athiesm subreddit issue.

3

u/ogrisel Aug 03 '09 edited Aug 03 '09

Adding bigram features should not be that expensive if you use the hashing trick that vowpal wabbit implements.

But I aggree this might not help much in that case. However it's still worth a try.

2

u/semanticprecision Aug 03 '09

Cool; learn something new every day...

2

u/lanthus Aug 03 '09

Yes, this is what I was about to suggest. Linear classifiers are fast and surprisingly effective with the right feature sets.