covartech / PRT

Pattern Recognition Toolbox for MATLAB
http://covartech.github.io/
MIT License
144 stars 70 forks source link

Add "update" methods to on-line classifiers (and write an on-line classifier) #24

Open peterTorrione opened 10 years ago

peterTorrione commented 10 years ago

A user asked for this, and it's

1) A good idea 2) Pretty easy to do (for some classifiers) 3) Useful

The goal is to update a prtAction "on-line" with batches of data. For some actions this is easier than others.

One approach:

1)A) Define a new super-class: prtOnline or prtStreaming or prtBatch or... something

Comes with an (Abstract? Default?) method. action = action.update(newData,...)

or 1)B) Add the "update" method to the list of default abstract methods in prtAction

2) "Update" enables on-line updating.
action = action.train(dataSet); action = action.update(dataSetNew);

Note: the default behavior here can be to do this:

function action = action.update(newData) totalData = catObservations(action.dataSet,newData); %if "dataStorage" is on action = action.train(totalData);

Though: 1) This is somewhat gross 2) This can be quite slow 3) It kind of violates the idea of "updating" (vs. re-training with all data)

Something to consider.