---
title: "fitted(to:eventHandler:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/standardscaler/fitted(to:eventhandler:)"
---

# fitted(to:eventHandler:)

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

## Declaration

```swift
func fitted<S>(to input: S, eventHandler: EventHandler? = nil) throws -> StandardScaler<Element>.Transformer where Element == S.Element, S : Sequence
```
