<!--
{
  "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/RandomTransformer",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents17RandomTransformerP"
  },
  "title" : "RandomTransformer"
}
-->

# RandomTransformer

A transformer that takes an input and a random number generator and produces a randomized output.

```
protocol RandomTransformer<Input, Output>
```

## Topics

### Performing the transformation

[`func applied(to: Self.Input, generator: inout some RandomNumberGenerator, eventHandler: EventHandler?) async throws -> Self.Output`](/documentation/CreateMLComponents/RandomTransformer/applied(to:generator:eventHandler:))

Performs the random transformation on a single input.

[`associatedtype Input`](/documentation/CreateMLComponents/RandomTransformer/Input)

The input type.

[`associatedtype Output`](/documentation/CreateMLComponents/RandomTransformer/Output)

The output type.

## Relationships

### Conforming Types

[`UniformRandomFloatingPointParameter`](/documentation/CreateMLComponents/UniformRandomFloatingPointParameter)

[`ApplyRandomly`](/documentation/CreateMLComponents/ApplyRandomly)

[`ShuffleRandomly`](/documentation/CreateMLComponents/ShuffleRandomly)

[`ApplyEachRandomly`](/documentation/CreateMLComponents/ApplyEachRandomly)

[`ChooseRandomly`](/documentation/CreateMLComponents/ChooseRandomly)

[`RandomImageCropper`](/documentation/CreateMLComponents/RandomImageCropper)

[`UniformRandomIntegerParameter`](/documentation/CreateMLComponents/UniformRandomIntegerParameter)

---

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)