General-purpose machine learning library for openFrameworks, supporting classification, regression, and clustering tasks
Switch branches/tags
Nothing to show
Clone or download
Latest commit 1521c34 Mar 9, 2017


ofxLearn is a general-purpose machine learning library for OpenFrameworks, built on top of dlib.


ofxLearn supports classification, regression, and unsupervised clustering. The goal is to be a high-level wrapper for dlib's machine learning routines, taking care of the ugly stuff, i.e. determining a model, kernel, and parameter selection).

The library contains a basic example for each of classification, regression, and clustering. Because training can take a long time, there are also examples for placing each of these tasks into its own separate thread.


ofxLearn supports classification (using kernel ridge regression), regression (using kernel ridge or multilayer perceptron (neural network)), and k-means clustering.

Also has an example for doing a principal component analysis via singular value decomposition. See example_pca.

Each has a separate class for threading (see the _threaded examples).


See examples for usage of classification, regression, and clustering. Depending on the size and complexity of your data, training can take a long time, and it will freeze the application, unless you use the threaded learners. The examples ending with _threaded run the training in a separate thread and alert you with a callback function when they are done.