Skip to main content
`Ctrl`+`K`

# PetscRegressorSetType

Sets the type for the regressor.

## Synopsis

    PetscErrorCode PetscRegressorSetType(PetscRegressor regressor, PetscRegressorType type)

Collective

## Input Parameters

- regressor - the `PetscRegressor` context

- type - a known regression method

## Options Database Key

- -regressor_type type - Sets the type of regressor; use -help for a list of available types

## Notes

See “include/petscregressor.h” for available methods (for instance)

- `PETSCREGRESSORLINEAR` - Regression model that is linear in its coefficients; supports ordinary least squares as well as regularized variants

Normally, it is best to use the `PetscRegressorSetFromOptions()` command and then set the `PetscRegressor` type from the options database rather than by using this routine, as this provides maximum flexibility. The `PetscRegressorSetType()` routine is provided for those situations where it is necessary to set the nonlinear solver independently of the command line or options database.

## See Also

`PetscRegressorType`

## Level

intermediate

## Location

src/ml/regressor/interface/regressor.c

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