Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Machine Learning by (19k points)

I am currently in the process of designing a recommender system for text articles (a binary case of 'interesting' or 'not interesting'). One of my specifications is that it should continuously update to changing trends.

From what I can tell, the best way to do this is to make use of a machine learning algorithm that supports incremental/online learning.

Algorithms like the Perceptron and Winnow support online learning but I am not completely certain about Support Vector Machines. Does the scikit-learn python library support online learning and if so, is a support vector machine one of the algorithms that can make use of it?

I am obviously not completely tied down to using support vector machines, but they are usually the go-to algorithm for binary classification due to their all-round performance. I would be willing to change to whatever fits best in the end.

1 Answer

0 votes
by (33.1k points)

There are some online algorithms for SVMs do exist, so it is important to specify if you want kernel or linear SVM, as many efficient algorithms have been developed for the special case of linear SVMs.

For the linear classification case, you should use the SGD classifier in scikit-learn with the hinge loss and L2 regularization, then simply you will get an SVM that can be updated online. You can combine this with feature transforms that approximate a kernel to get similar to an online kernel SVM.

You can use the PassiveAggresive classifier that will give you better results, as it's learning rate does not decrease w.r.t. time.

While training you can attempt to detect decreases in accuracy over time and begin training a new model when the accuracy starts to decrease (and switch to the new one when you believe that it has become more accurate). It also has more online linear and kernel methods.

Hope this answer helps.

Learn SVM with this Support Vector Machine Tutorial.

Browse Categories

...