Skip to main content
`Ctrl`+`K`

# PetscRegressorLinearSetType

Sets the type of linear regression to be performed

## Synopsis

    #include "petscregressor.h"
    PetscErrorCode PetscRegressorLinearSetType(PetscRegressor regressor, PetscRegressorLinearType type)

Logically Collective

## Input Parameters

- regressor - the `PetscRegressor` context (should be of type `PETSCREGRESSORLINEAR`)

- type - a known linear regression method

## Options Database Key

- -regressor_linear_type - Sets the linear regression method; use -help for a list of available methods (for instance “-regressor_linear_type ols” or “-regressor_linear_type lasso”)

## See Also

`PetscRegressorLinearGetType()`, `PetscRegressorLinearType`, `PetscRegressorSetType()`, `REGRESSOR_LINEAR_OLS`, `REGRESSOR_LINEAR_LASSO`, `REGRESSOR_LINEAR_RIDGE`

## Level

intermediate

## Location

src/ml/regressor/impls/linear/linear.c

## Implementations

PetscRegressorLinearSetType_Linear() in src/ml/regressor/impls/linear/linear.c

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