# Linear discriminant analysis via MASS

Source:`R/discrim_linear_MASS.R`

`details_discrim_linear_MASS.Rd`

`MASS::lda()`

fits a model that estimates a multivariate
distribution for the predictors separately for the data in each class
(Gaussian with a common covariance matrix). Bayes' theorem is used
to compute the probability of each class, given the predictor values.

## Details

For this engine, there is a single mode: classification

### Translation from parsnip to the original package

The **discrim** extension package is required to fit this model.

```
library(discrim)
discrim_linear() %>%
set_engine("MASS") %>%
translate()
```

### Preprocessing requirements

Factor/categorical predictors need to be converted to numeric values
(e.g., dummy or indicator variables) for this engine. When using the
formula method via `fit()`

, parsnip will
convert factor columns to indicators.

Variance calculations are used in these computations so *zero-variance*
predictors (i.e., with a single unique value) should be eliminated
before fitting the model.