Skip to main content
`Ctrl`+`K`

# PetscRegressorLinearType

Type of linear regression

## Synopsis

    typedef enum {
      REGRESSOR_LINEAR_OLS,
      REGRESSOR_LINEAR_LASSO,
      REGRESSOR_LINEAR_RIDGE
    } PetscRegressorLinearType;

## Values

- `REGRESSOR_LINEAR_OLS` - ordinary least squares

- `REGRESSOR_LINEAR_LASSO` - lasso

- `REGRESSOR_LINEAR_RIDGE` - ridge

## Note

One can perform binary classification using the ridge regressor type by converting labels into the values -1 and +1, corresponding to the two classes, and then performing a ridge regression. Observations with a negative prediction value are then placed in the -1 class, while those with positive values are placed in the +1 class. This is the approach used in the RidgeClassifer implementation provided by the scikit-learn library.

## See Also

`PetscRegressor`, `PETSCREGRESSORLINEAR`

## Level

advanced

## Location

include/petscregressor.h

Index of all PetscRegressor routines
Table of Contents for all manual pages
Index of all manual pages