# discardSupportVectors

**Class: **classreg.learning.regr.CompactRegressionSVM, RegressionSVM

**Namespace: **classreg.learning.regr

Discard support vectors for linear support vector machine (SVM) regression model

## Syntax

`mdlOut = discardSupportVectors(mdl)`

## Description

returns the trained, linear support vector machine (SVM) regression model
`mdlOut`

= discardSupportVectors(`mdl`

)`mdlOut`

, which is similar to the trained, linear SVM regression model
`mdl`

, except:

The

`Alpha`

and`SupportVectors`

properties are empty (`[]`

).If you display

`mdlOut`

, the software lists the`Beta`

property instead of the`Alpha`

property.

## Input Arguments

## Output Arguments

## Examples

## Tips

For a trained, linear SVM regression model, the `SupportVectors`

property
is an *n _{sv}*-by-

*p*matrix.

*n*is the number of support vectors (at most the training sample size) and

_{sv}*p*is the number of predictor variables. If any of the predictors are categorical, then

*p*includes the number of dummy variables necessary to account for all of the categorical predictor levels. The

`Alpha`

property is a vector with
*n*elements.

_{sv}The `SupportVectors`

and `Alpha`

properties can be large
for complex data sets that contain many observations or examples. However, the
`Beta`

property is a vector with *p* elements, which may
be considerably smaller. You can use a trained SVM regression model to predict response values
even if you discard the support vectors because the `predict`

and `resubPredict`

methods use `Beta`

to
compute the predicted responses.

If the trained, linear SVM regression model has many support vectors, use `discardSupportVectors`

to reduce the amount of disk space that the
trained, linear SVM regression model consumes. You can display the size of the support vector
matrix by entering `size(mdlIn.SupportVectors)`

.

## Algorithms

The `predict`

and `resubPredict`

estimate response values using the
formula

$$f\left(x\right)=\left(\frac{X}{S}\right)\beta +{\beta}_{0}\text{\hspace{0.17em}},$$

where:

β is the Beta value, stored as

`mdl.Beta`

.β

_{0}is the bias value, stored as`mdl.Bias`

.`X`

is the training data.`S`

is the kernel scale value, stored as`mdl.KernelParameters.Scale`

.

In this way, the software can use the value of `mdl.Beta`

to make
predictions even after discarding the support vectors.

## Extended Capabilities

## Version History

**Introduced in R2015b**

## See Also

`fitrsvm`

| `RegressionSVM`

| `CompactRegressionSVM`

| `predict`

| `resubPredict`