---
title: l1Penalty
framework: createmlcomponents
role: symbol
role_heading: Instance Property
path: createmlcomponents/linearregressor/configuration-swift.struct/l1penalty
---

# l1Penalty

Weight of the L1 regularization term.

## Declaration

```swift
var l1Penalty: Double
```

## Discussion

Discussion Like the l2 penalty, the higher the l1 penalty, the more the estimated coefficients shrink toward 0. The l1 penalty, however, completely zeros out sufficiently small coefficients, automatically indicating features that are not useful for the model. The default weight of 0 prevents any features from being discarded.

## See Also

### Getting the properties

- [convergenceThreshold](createmlcomponents/linearregressor/configuration-swift.struct/convergencethreshold.md)
- [earlyStopIterationCount](createmlcomponents/linearregressor/configuration-swift.struct/earlystopiterationcount.md)
- [l2Penalty](createmlcomponents/linearregressor/configuration-swift.struct/l2penalty.md)
- [maximumIterations](createmlcomponents/linearregressor/configuration-swift.struct/maximumiterations.md)
- [optimizationStrategy](createmlcomponents/linearregressor/configuration-swift.struct/optimizationstrategy.md)
- [scaleFeatures](createmlcomponents/linearregressor/configuration-swift.struct/scalefeatures.md)
- [stepSize](createmlcomponents/linearregressor/configuration-swift.struct/stepsize.md)
