---
title: "stratifiedSplit(proportions:generator:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mlsoundclassifier/datasource/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.

## Declaration

```swift
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

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.

## See Also

### Partitioning the data

- [stratifiedSplit(proportions:seed:)](createml/mlsoundclassifier/datasource/stratifiedsplit(proportions:seed:).md)
