SingularValueDecompositionLinearRegression
public class SingularValueDecompositionLinearRegression : LinearRegression
Singular value decomposition linear regression.
Reference: “Use of the Singular Value Decomposition in Regression Analysis”
-
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
fitIntercept
Whether 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
data
Training data with shape
[sample count, feature count]
.labels
Target value with shape
[sample count, target count]
.