Skip to main content
`Ctrl`+`K`

# PetscRegressorLinearSetFitIntercept

Set a flag to indicate that the intercept (also known as the “bias” or “offset”) should be calculated; data are assumed to be mean-centered if false.

## Synopsis

    #include "petscregressor.h"
    PetscErrorCode PetscRegressorLinearSetFitIntercept(PetscRegressor regressor, PetscBool flg)

Logically Collective

## Input Parameters

- regressor - the `PetscRegressor` context

- flg - `PETSC_TRUE` to calculate the intercept, `PETSC_FALSE` to assume mean-centered data (default is `PETSC_TRUE`)

## Options Database Key

- regressor_linear_fit_intercept (true|false) - fit the intercept

## Note

If the user indicates that the intercept should not be calculated, the intercept will be set to zero.

## See Also

`PetscRegressor`, `PetscRegressorFit()`

## Level

intermediate

## Location

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

## Implementations

PetscRegressorLinearSetFitIntercept_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