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

# EstimatorToSupervisedAdaptor

An adaptor that exposes an estimator as a supervised estimator.

```
struct EstimatorToSupervisedAdaptor<Estimator, Annotation> where Estimator : Estimator, Annotation : Equatable
```

## Topics

### Creating the adaptor

[`init(Estimator)`](/documentation/CreateMLComponents/EstimatorToSupervisedAdaptor/init(_:))

Creates an estimator adaptor.

### Getting the properties

[`let estimator: Estimator`](/documentation/CreateMLComponents/EstimatorToSupervisedAdaptor/estimator)

The wrapped estimator.

### Encoding and decoding

[`func encode(EstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer, to: inout any EstimatorEncoder) throws`](/documentation/CreateMLComponents/EstimatorToSupervisedAdaptor/encode(_:to:))

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

[`func decode(from: inout any EstimatorDecoder) throws -> EstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer`](/documentation/CreateMLComponents/EstimatorToSupervisedAdaptor/decode(from:))

Returns the pre-defined transformer.

### Fitting a transformer

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

Fits a transformer to a sequence of examples, ignoring the annotations and the validation.

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

Fits a transformer to a sequence of examples.

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

A transformer that takes an input and produces an output.

## Relationships

### Conforms To

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

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