<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/LinearRegressor/Configuration-swift.struct/l1Penalty",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents15LinearRegressorV13ConfigurationV9l1PenaltySdvp"
  },
  "title" : "l1Penalty"
}
-->

# l1Penalty

Weight of the L1 regularization term.

```
var l1Penalty: Double
```

## 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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)