<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLLinearRegressor/makeTrainingSession(trainingData:targetColumn:featureColumns:parameters:sessionParameters:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML17MLLinearRegressorV19makeTrainingSession12trainingData12targetColumn14featureColumns10parameters17sessionParametersAA010MLTrainingG0CyACG07TabularI00I5FrameV_SSSaySSGSgAC05ModelP0VAA0qgP0VtKFZ::OverloadGroup"
  },
  "title" : "makeTrainingSession(trainingData:targetColumn:featureColumns:parameters:sessionParameters:)"
}
-->

# makeTrainingSession(trainingData:targetColumn:featureColumns:parameters:sessionParameters:)

Creates or restores a training session.

```
static func makeTrainingSession(trainingData: DataFrame, targetColumn: String, featureColumns: [String]? = nil, parameters: MLLinearRegressor.ModelParameters = .init(validation: .split(strategy: .automatic)), sessionParameters: MLTrainingSessionParameters = _defaultSessionParameters) throws -> MLTrainingSession<MLLinearRegressor>
```

## Parameters

`trainingData`

A `DataFrame` specifying training data.

`targetColumn`

A String specifying the target column name in the trainingData

`featureColumns`

An optional list of Strings specifying feature columns to be
used to predict the target, if not provided, default to use all the
other columns in the trainingData, except the one specified by targetColumn

`parameters`

Model training parameters. See [`MLLinearRegressor.ModelParameters`](/documentation/CreateML/MLLinearRegressor/ModelParameters-swift.struct) for the defaults.

`sessionParameters`

Training session parameters. See [`MLTrainingSessionParameters`](/documentation/CreateML/MLTrainingSessionParameters) for the defaults.

## Return Value

A `MLTrainingSession` that can be used to start or resume training.

---

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)