MLlab provides several algorithms for regression tasks. The most basic is the linear regression. It is designed to fit data with an underlying linear dependencies on an arbitrary dimensional set of features.

val reg = new LinearRegressor()

This is a basic example for the case of a 1D feature vector and a 1D label. The training and testing data have been drawn from a linear function with Gaussian noise. The figures show the performance on the test set.

Linear test

Using a trick, the internal addition of higher orders of the features, linear algorithms can be applied to non-linear datasets.

val reg = new LinearRegressor(degree=3)

This is an example of the same algorithm applied to data with a cubic dependence, where powers up until cubic powers of the feature have been added to the feature vector.

Nonlinear test