LinearTensorModel class

Linear regression model for scalar variables.

Example

import 'package:calc/calc.dart';

void main() {
  final model = LinearTensorModel(
    coefficients: VectorF([1,2,3]),
    constants: VectorF([0,0,0]),
  );
  final x = <double>[1,1,1];
  final y = model.predict(x);
  print('Predicted Y: $y');
}
Inheritance

Constructors

LinearTensorModel({required Tensor<double> coefficients, required Tensor<double> constants})

Properties

coefficients Tensor<double>
final
constants Tensor<double>
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
predict(Tensor<double> x) Tensor<double>
Calculates prediction.
override
predictAsync(Tensor<double> x) Future<Tensor<double>>
Calculates prediction asynchronously.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override