<!--
{
  "availability" : [
    "macOS: 10.15.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLObjectDetector/ModelParameters-swift.struct/init(validationData:batchSize:maxIterations:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML16MLObjectDetectorV15ModelParametersV14validationData9batchSize13maxIterationsAeC0H6SourceO_SiSgAKtKcfc"
  },
  "title" : "init(validationData:batchSize:maxIterations:)"
}
-->

# init(validationData:batchSize:maxIterations:)

Creates a model parameters instance for an object-detector training session set to use the full network algorithm.

```
init(validationData: MLObjectDetector.DataSource, batchSize: Int? = nil, maxIterations: Int? = nil) throws
```

## Parameters

`validationData`

An [`MLObjectDetector.ModelParameters.ValidationData`](/documentation/CreateML/MLObjectDetector/ModelParameters-swift.struct/ValidationData) instance that
contains your validation dataset.

`batchSize`

The number of images the object detector uses for each training iteration. If you don’t have
a preference, set this parameter to `nil` to tell Create ML to use an appropriate value when it trains
the model.

`maxIterations`

The largest number of training iterations the object detector can use. If you don’t have
a preference, set this parameter to `nil` to tell Create ML to use an appropriate value when it trains
the model.

---

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)