---
title: "init(probability:_:)"
framework: createmlcomponents
role: symbol
role_heading: Initializer
path: "createmlcomponents/applyrandomly/init(probability:_:)"
---

# init(probability:_:)

Creates an apply randomly augmentation.

## Declaration

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