LeastSquaresLinearRegression
public class LeastSquaresLinearRegression : LinearRegression
Least Squares linear regression.
Reference: “Least Squares linear regression”
-
Whether to calculate the intercept for this model.
Declaration
Swift
public var fitIntercept: Bool -
The weights of the model.
Declaration
Swift
public var weights: Tensor<Float> -
Creates a linear regression model.
Declaration
Swift
public init( fitIntercept: Bool = true )Parameters
fitInterceptWhether to calculate the intercept for this model. If
false, no intercept will be used in calculations. The default istrue. -
Fit a linear model.
Declaration
Swift
public func fit(data: Tensor<Float>, labels: Tensor<Float>)Parameters
dataTraining data with shape
[sample count, feature count].labelsTarget value with shape
[sample count, target count].
LeastSquaresLinearRegression Class Reference