Solved – Can SVM do stream learning one example at a time

machine learningneural networkssvm

I have a streaming data set, examples are available one at a time. I would need to do multi class classification on them. As soon as I fed a training example to the learning process, I have to discard the example. Concurrently, I'm also using the latest model to perform prediction on unlabelled data.

As far as I know, a neural network is able to do stream learning by feeding examples one at a time and performing forward propagation and backward propogation on the example.

Can a SVM perform stream learning one example at a time and discard the example straight away?

Best Answer

The streaming setting in machine learning is called "online learning". There is no exact support vector machine in the online setting (since the definition of the objective function is inherently for the batch setting). Probably the most straightforward generalization of the SVM to the online setting are passive-aggressive algorithms. Code is here http://webee.technion.ac.il/people/koby/code-index.html and an associated paper is here http://eprints.pascal-network.org/archive/00002147/01/CrammerDeKeShSi06.pdf

The basic idea is that one recieves data as $(\mathbf{x},y)\in\mathbb{R}^d\times [k]$ pairs with query points $\mathbf{x}\in \mathbb{R}$ where $k$ is the number of labels. The algorithm maintains a weight matrix $W_t\in \mathbb{R}^{k\times d}$ at iteration $t$ the algorithms recieves a data point $\mathbf{x}_t$ and then gives predicted scores $\hat{\mathbf{y}}_t=W\mathbf{x}_t$ for each of the labels and it predicts the highest scoring label as the true label. If the prediction is wrong then the algorithm makes the smallest change to $W_t$ such that it will avoid that mistake in the future. Smallest change is here defined in terms of the Frobenius norm.