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

# TransformerToEstimatorAdaptor

An estimator that always returns a predefined transformer.

```
struct TransformerToEstimatorAdaptor<Transformer> where Transformer : Transformer
```

## Topics

### Creating a feature

[`init(Transformer)`](/documentation/CreateMLComponents/TransformerToEstimatorAdaptor/init(_:))

Creates a trivial estimator.

### Getting the transformer

[`let transformer: Transformer`](/documentation/CreateMLComponents/TransformerToEstimatorAdaptor/transformer)

A pre-defined transformer.

### Encoding and Decoding

[`func encode(Transformer, to: inout any EstimatorEncoder) throws`](/documentation/CreateMLComponents/TransformerToEstimatorAdaptor/encode(_:to:))

Does nothing since this estimator uses a pre-defined transformer.

[`func decode(from: inout any EstimatorDecoder) throws -> Transformer`](/documentation/CreateMLComponents/TransformerToEstimatorAdaptor/decode(from:))

Returns the pre-defined transformer.

### Fitting

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

Returns the pre-defined transformer.

## Relationships

### Conforms To

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

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

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

---

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)