<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/ApplyEachRandomly/init(probability:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents17ApplyEachRandomlyV11probability_ACyxGSd_qd__yXEtc5InputQyd__RszAA17RandomTransformerRd__6OutputQyd__AGRSlufc"
  },
  "title" : "init(probability:_:)"
}
-->

# init(probability:_:)

Creates an augmentation that applies each transformer randomly in the given order.

```
init<RandomTransformer>(probability: Double = 0.5, @AugmentationBuilder<Element> _ augmentation: () -> RandomTransformer) where Element == RandomTransformer.Input, RandomTransformer : RandomTransformer, RandomTransformer.Input == RandomTransformer.Output
```

## Parameters

`probability`

The probability of applying each transformer. Default value is 0.5.

`augmentation`

An augmentation builder.

---

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)