---
title: ApplyRandomly
framework: createmlcomponents
role: symbol
role_heading: Structure
path: createmlcomponents/applyrandomly
---

# ApplyRandomly

Randomly applies the transformer with the given probability.

## Declaration

```swift
struct ApplyRandomly<RandomTransformer> where RandomTransformer : RandomTransformer, RandomTransformer.Input == RandomTransformer.Output
```

## Topics

### Creating an augmentation

- [init(probability:_:)](createmlcomponents/applyrandomly/init(probability:_:).md)

### Getting the probability

- [probability](createmlcomponents/applyrandomly/probability.md)

### Applying transformers

- [applied(to:generator:eventHandler:)](createmlcomponents/applyrandomly/applied(to:generator:eventhandler:).md)

## Relationships

### Conforms To

- [RandomTransformer](createmlcomponents/randomtransformer.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Augmentations

- [ApplyEachRandomly](createmlcomponents/applyeachrandomly.md)
- [AugmentationBuilder](createmlcomponents/augmentationbuilder.md)
- [AugmentationSequence](createmlcomponents/augmentationsequence.md)
- [Augmenter](createmlcomponents/augmenter.md)
- [ChooseRandomly](createmlcomponents/chooserandomly.md)
- [RandomImageCropper](createmlcomponents/randomimagecropper.md)
- [ShuffleRandomly](createmlcomponents/shufflerandomly.md)
- [UniformRandomFloatingPointParameter](createmlcomponents/uniformrandomfloatingpointparameter.md)
- [UniformRandomIntegerParameter](createmlcomponents/uniformrandomintegerparameter.md)
- [UpsampledAugmentationSequence](createmlcomponents/upsampledaugmentationsequence.md)
