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

# StandardScaler

An estimator that standardizes the input by removing the mean and scaling to unit variance.

```
struct StandardScaler<Element> where Element : BinaryFloatingPoint, Element : Decodable, Element : Encodable
```

## Topics

### Creating an estimator

[`init()`](/documentation/CreateMLComponents/StandardScaler/init())

Creates a standard scaling estimator.

### Fitting

[`func fitted<S>(to: S, eventHandler: EventHandler?) throws -> StandardScaler<Element>.Transformer`](/documentation/CreateMLComponents/StandardScaler/fitted(to:eventHandler:))

Fits a transformer to a particular input sequence by computing the mean and standard deviation.

### Default Implementations

[Estimator Implementations](/documentation/CreateMLComponents/StandardScaler/Estimator-Implementations)

[UpdatableEstimator Implementations](/documentation/CreateMLComponents/StandardScaler/UpdatableEstimator-Implementations)

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)