<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLSoundClassifier/DataSource/stratifiedSplit(proportions:generator:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML17MLSoundClassifierV10DataSourceO15stratifiedSplit11proportions9generatorSaySDySSSay10Foundation3URLVGGGSaySdG_xztKSGRzlF"
  },
  "title" : "stratifiedSplit(proportions:generator:)"
}
-->

# stratifiedSplit(proportions:generator:)

Generates an array of labeled audio dictionaries by splitting the data source into strata using the
random-number generator.

```
func stratifiedSplit<RNG>(proportions: [Double], generator: inout RNG) throws -> [[String : [URL]]] where RNG : RandomNumberGenerator
```

## Parameters

`proportions`

An array of proportions, each in the range `[0.0, 1.0]`.

`generator`

A random-number generator.

## Return Value

An array of dictionaries of labeled audio files. Each dictionary key is a label string and its
value is an array of audio-file URLs.

---

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)