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

# LogisticRegressionClassifier

A logistic regression classifier.

```
struct LogisticRegressionClassifier<Scalar, Label> where Scalar : MLShapedArrayScalar, Scalar : BinaryFloatingPoint, Label : Comparable, Label : Decodable, Label : Encodable, Label : Hashable
```

## Topics

### Creating a classifier

[`init(labels:configuration:)`](/documentation/CreateMLComponents/LogisticRegressionClassifier/init(labels:configuration:))

Creates a logistic regression classifier.

[`Configuration`](/documentation/CreateMLComponents/LogisticRegressionClassifier/Configuration-swift.struct)

A logistic regression classifier configuration.

### Getting the properties

[`configuration`](/documentation/CreateMLComponents/LogisticRegressionClassifier/configuration-swift.property)

The logistic regression classifier configuration.

[`labels`](/documentation/CreateMLComponents/LogisticRegressionClassifier/labels)

The set of possible labels.

### Encoding and decoding

[`encodeWithOptimizer(_:to:)`](/documentation/CreateMLComponents/LogisticRegressionClassifier/encodeWithOptimizer(_:to:))

Encodes the transformer and optimizer to an encoder.

[`decodeWithOptimizer(from:)`](/documentation/CreateMLComponents/LogisticRegressionClassifier/decodeWithOptimizer(from:))

Reads the encoded transformer and optimizer with a decoder.

### Fitting

[`fitted(to:eventHandler:)`](/documentation/CreateMLComponents/LogisticRegressionClassifier/fitted(to:eventHandler:))

Fits a logistic regression classifier model to a sequence of examples while validating with a validation sequence.

[`fitted(to:validateOn:eventHandler:)`](/documentation/CreateMLComponents/LogisticRegressionClassifier/fitted(to:validateOn:eventHandler:))

Fits a logistic regression classifier model to a sequence of examples.

[`Annotation`](/documentation/CreateMLComponents/LogisticRegressionClassifier/Annotation)

The annotation type.

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

The transformer type created by this estimator.

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)