This Page

Regression methods

class composes.utils.regression_learner.LstsqRegressionLearner(**kwargs)

This class performs Least Squares Regression.

It finds the matrix X which solves:

\(X = argmin(||AX - B||_2)\)

It can be used with intercept or without (by default intercept=True).

class composes.utils.regression_learner.RegressionLearner

Implements a set of regression methods.

Supported regression methods are least squares regression and ridge regression. Ridge regression can be used with generalized cross validation. (Hastie, Tibshirani and Friedman, Second edition, page 244)

class composes.utils.regression_learner.RidgeRegressionLearner(**kwargs)

This class performs Ridge Regression.

It finds the matrix X which solves:

\(X = argmin(||AX - B||_2 + \lambda||X||_2)\)

It can be used with intercept or without (by default intercept=True). Cross validation can be used with default \(\lambda\) range of \(linspace(0, 5, 11)\). By default Generalized cross validation is performed. If cross validation is set False it requires the input of a \(\lambda\) value.

train(matrix_a, matrix_b)

If cross validation is set to True, it performs generalized cross validation. (Hastie, Tibshirani and Friedman, Second edition, page 244).