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

# PreprocessingSupervisedEstimator

A supervised estimator that composes a preprocessing transformer and a supervised estimator.

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

## Topics

### Creating the estimator

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

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

### Getting the properties

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

The estimator.

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

The preprocessing transformer.

### Preprocessing and fitting

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

Preprocesses a sequence of examples.

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

Fits a composed transformer to a sequence of examples.

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

Fits a transformer to a sequence of preprocessed features.

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

Fits a composed transformer to a sequence of examples.

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

Fits a composed transformer to a sequence of preprocessed features.

[`typealias Annotation`](/documentation/CreateMLComponents/PreprocessingSupervisedEstimator/Annotation)

The annotation type.

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

The input type.

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

The intermediate type.

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

The output type.

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

A transformer that takes an input and produces an output.

## Relationships

### Conforms To

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

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

[`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)