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

# PreprocessingEstimator

An estimator that composes a preprocessing transformer and an estimator.

```
struct PreprocessingEstimator<Preprocessor, Estimator> where Preprocessor : Transformer, Estimator : Estimator, Preprocessor.Output == Estimator.Transformer.Input
```

## Topics

### Creating an estimator

[`init(Preprocessor, Estimator)`](/documentation/CreateMLComponents/PreprocessingEstimator/init(_:_:))

Creates a composed estimator from a preprocessing transformer and an estimator.

### Getting the properties

[`var estimator: Estimator`](/documentation/CreateMLComponents/PreprocessingEstimator/estimator)

The estimator.

[`var preprocessor: Preprocessor`](/documentation/CreateMLComponents/PreprocessingEstimator/preprocessor)

The preprocessing transformer.

### Preprocesing and fitting

[`func preprocessed<S>(from: S, eventHandler: EventHandler?) async throws -> [Preprocessor.Output]`](/documentation/CreateMLComponents/PreprocessingEstimator/preprocessed(from:eventHandler:))

Preprocesses a sequence of examples.

[`func fitted<S>(to: S, eventHandler: EventHandler?) async throws -> PreprocessingEstimator<Preprocessor, Estimator>.Transformer`](/documentation/CreateMLComponents/PreprocessingEstimator/fitted(to:eventHandler:))

Fits a composed transformer to a sequence of examples.

[`func fitted<S>(toPreprocessed: S, eventHandler: EventHandler?) async throws -> PreprocessingEstimator<Preprocessor, Estimator>.Transformer`](/documentation/CreateMLComponents/PreprocessingEstimator/fitted(toPreprocessed:eventHandler:))

Fits a transformer to a sequence of preprocessed features.

[`typealias Input`](/documentation/CreateMLComponents/PreprocessingEstimator/Input)

The input type.

[`typealias Intermediate`](/documentation/CreateMLComponents/PreprocessingEstimator/Intermediate)

The intermediate type.

[`typealias Output`](/documentation/CreateMLComponents/PreprocessingEstimator/Output)

The output type.

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

A transformer that takes an input and produces an output.

## Relationships

### Conforms To

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

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

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

---

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)