<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLSoundClassifier/train(trainingData:parameters:sessionParameters:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML17MLSoundClassifierV5train12trainingData10parameters17sessionParametersAA5MLJobCyACGAC0G6SourceO_AC05ModelJ0VAA017MLTrainingSessionJ0VtKFZ::OverloadGroup"
  },
  "title" : "train(trainingData:parameters:sessionParameters:)"
}
-->

# train(trainingData:parameters:sessionParameters:)

Begins an asynchronous sound classifier training session with a training dataset represented by a data source.

```
static func train(trainingData: MLSoundClassifier.DataSource, parameters: MLSoundClassifier.ModelParameters = ModelParameters(), sessionParameters: MLTrainingSessionParameters = _defaultSessionParameters) throws -> MLJob<MLSoundClassifier>
```

## Parameters

`trainingData`

A collection of labeled audio files represented by an [`MLSoundClassifier.DataSource`](/documentation/CreateML/MLSoundClassifier/DataSource).

`parameters`

An [`MLSoundClassifier.ModelParameters`](/documentation/CreateML/MLSoundClassifier/ModelParameters-swift.struct) instance you use to configure the model
for the training session.

`sessionParameters`

An [`MLTrainingSessionParameters`](/documentation/CreateML/MLTrainingSessionParameters) instance you use to configure the training session.

## Return Value

An [`MLJob`](/documentation/CreateML/MLJob) that represents the sound classifier training session.

---

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)