IRLRegression

class menpofit.math.IRLRegression(alpha=0, bias=True, incrementable=False)[source]

Bases: object

Class for training and applying Incremental Regularized Linear Regression.

Parameters
  • alpha (float, optional) – The regularization parameter of the features.

  • bias (bool, optional) – If True, a bias term is used.

  • incrementable (bool, optional) – If True, then the regression model will have the ability to get incremented.

increment(X, Y)[source]

Incrementally update the regression model.

Parameters
  • X ((n_features, n_samples) ndarray) – The array of feature vectors.

  • Y ((n_dims, n_samples) ndarray) – The array of target vectors.

Raises

ValueError – Model is not incrementable

predict(x)[source]

Makes a prediction using the trained regression model.

Parameters

x ((n_features,) ndarray) – The input feature vector.

Returns

prediction ((n_dims,) ndarray) – The prediction vector.

train(X, Y)[source]

Train the regression model.

Parameters
  • X ((n_features, n_samples) ndarray) – The array of feature vectors.

  • Y ((n_dims, n_samples) ndarray) – The array of target vectors.