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

# LinearRegressorModel

A trained linear regressor model.

```
struct LinearRegressorModel<Scalar> where Scalar : MLShapedArrayScalar, Scalar : BinaryFloatingPoint
```

## Topics

### Creating a regressor model

[`init(coefficients: some Sequence<Scalar>)`](/documentation/CreateMLComponents/LinearRegressorModel/init(coefficients:))

Creates a linear regression model.

### Getting the properties

[`var featureCount: Int`](/documentation/CreateMLComponents/LinearRegressorModel/featureCount)

The number of features expected in the input.

[`var coefficients: [Scalar]`](/documentation/CreateMLComponents/LinearRegressorModel/coefficients)

The linear coefficients.

### Performing the regression

[`func applied(to: MLShapedArray<Scalar>, eventHandler: EventHandler?) async throws -> Scalar`](/documentation/CreateMLComponents/LinearRegressorModel/applied(to:eventHandler:))

Performs a regression on a single input.

## Relationships

### Conforms To

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

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

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

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