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

# PreprocessingUpdatableEstimator

An updatable estimator that composes a preprocessing transformer and an updatable estimator.

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

## Topics

### Creating an estimator

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

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

### Getting the properties

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

The estimator.

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

The preprocessing transformer.

### Encoding and decoding

[`func decodeWithOptimizer(from: inout any EstimatorDecoder) throws -> PreprocessingUpdatableEstimator<Preprocessor, Estimator>.Transformer`](/documentation/CreateMLComponents/PreprocessingUpdatableEstimator/decodeWithOptimizer(from:))

Reads the encoded transformer and optimizer.

[`func encodeWithOptimizer(PreprocessingUpdatableEstimator<Preprocessor, Estimator>.Transformer, to: inout any EstimatorEncoder) throws`](/documentation/CreateMLComponents/PreprocessingUpdatableEstimator/encodeWithOptimizer(_:to:))

Encodes the transformer and optimizer to an encoder.

### Preprocesing and fitting

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

Preprocesses a sequence of examples.

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

Fits a composed transformer to a sequence of examples.

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

Fits a transformer to a sequence of preprocessed features.

[`func makeTransformer() -> PreprocessingUpdatableEstimator<Preprocessor, Estimator>.Transformer`](/documentation/CreateMLComponents/PreprocessingUpdatableEstimator/makeTransformer())

Creates a default-initialized transformer suitable for incremental fitting.

[`func update<InputSequence>(inout PreprocessingUpdatableEstimator<Preprocessor, Estimator>.Transformer, with: InputSequence, eventHandler: EventHandler?) async throws`](/documentation/CreateMLComponents/PreprocessingUpdatableEstimator/update(_:with:eventHandler:))

Updates a transformer with a new sequence of examples.

[`func update<InputSequence>(inout PreprocessingUpdatableEstimator<Preprocessor, Estimator>.Transformer, withPreprocessed: InputSequence, eventHandler: EventHandler?) async throws`](/documentation/CreateMLComponents/PreprocessingUpdatableEstimator/update(_:withPreprocessed:eventHandler:))

Updates a transformer with a new sequence of preprocessed features.

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

The input type.

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

The intermediate type.

[`typealias Output`](/documentation/CreateMLComponents/PreprocessingUpdatableEstimator/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)

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

---

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)