<!--
{
  "availability" : [
    "iOS: 15.0.0 - 16.0.0",
    "iPadOS: 15.0.0 - 16.0.0",
    "macCatalyst: 15.0.0 - 16.0.0",
    "macOS: 10.14.0 - 11.0.0",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLLinearRegressor/ModelParameters-swift.struct/init(validationData:maxIterations:l1Penalty:l2Penalty:stepSize:convergenceThreshold:featureRescaling:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML17MLLinearRegressorV15ModelParametersV14validationData13maxIterations9l1Penalty02l2L08stepSize20convergenceThreshold16featureRescalingAeA11MLDataTableVSg_SiS4dSbtcfc"
  },
  "title" : "init(validationData:maxIterations:l1Penalty:l2Penalty:stepSize:convergenceThreshold:featureRescaling:)"
}
-->

# init(validationData:maxIterations:l1Penalty:l2Penalty:stepSize:convergenceThreshold:featureRescaling:)

Creates a new set of parameters.

```
init(validationData: MLDataTable? = nil, maxIterations: Int = 10, l1Penalty: Double = 0, l2Penalty: Double = 0.01, stepSize: Double = 1.0, convergenceThreshold: Double = 0.01, featureRescaling: Bool = true)
```

## Parameters

`validationData`

The dataset used to monitor how well the model is generalizing.

    The default value is     `nil`     which will use an automatically sampled validation set.

`maxIterations`

The maximum number of passes through the data.

    The default value is 10.

`l1Penalty`

Weight on the l1-regularizer. The l1Penalty zeros out small coefficients, indicating
features that are not useful for the  model.

    The default value is 0 which prevents any values from being discarded.

`l2Penalty`

Weight of the l2-regularizer. The larger the l2Penalty the less variance in the model.

    The default value is 0.01.

`stepSize`

The adjustment size that should be made by the underlying solver. Values close to 1.0 take an
aggressive step based off feedback from each training iteration.

    The default value is 1.0.

`convergenceThreshold`

The threshold with which to determine if the model has converged. Consider
reducing this value for higher training accuracy, but beware of overfitting.

    The default value is 0.01.

`featureRescaling`

Determines if the features should be preprocessed to ensure all features are on the
same scale.

    The default value is true.

---

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)