<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/RobustScaler/Transformer",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML Components",
      "CreateMLComponents"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents12RobustScalerV11TransformerV"
  },
  "title" : "RobustScaler.Transformer"
}
-->

# RobustScaler.Transformer

A transformer that scales the input using statistics that are robust to outliers.

```
struct Transformer
```

## Topics

### Creating a transformer

[`init(median: Element, interQuartileRange: Element)`](/documentation/CreateMLComponents/RobustScaler/Transformer/init(median:interQuartileRange:))

Creates a robust scaling transformer.

### Getting the properties

[`var interQuartileRange: Element`](/documentation/CreateMLComponents/RobustScaler/Transformer/interQuartileRange)

The interquartile rage  used for scaling.

[`var median: Element`](/documentation/CreateMLComponents/RobustScaler/Transformer/median)

The median used for offsetting.

### Performing the transformation

[`func applied(to: Element, eventHandler: EventHandler?) -> Element`](/documentation/CreateMLComponents/RobustScaler/Transformer/applied(to:eventHandler:))

Scales the input values using the calculation `(input - median) / interQuartileRange`.

## Relationships

### Conforms To

[`Copyable`](/documentation/Swift/Copyable)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Decodable`](/documentation/Swift/Decodable)

[`Escapable`](/documentation/Swift/Escapable)

[`Encodable`](/documentation/Swift/Encodable)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

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

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

---

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)