<!--
{
  "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/ApplyRandomly/init(probability:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents13ApplyRandomlyV11probability_ACyxGSd_xyXEtc5InputQzRsd__lufc"
  },
  "title" : "init(probability:_:)"
}
-->

# init(probability:_:)

Creates an apply randomly augmentation.

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

## Parameters

`probability`

The probability of applying the transformation. Must be greater than or equal to 0 and less
than or equal to 1, the default value is 0.5.

`augmentation`

The transformer to apply randomly.

---

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)