LinearTensorModel class Null safety

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. [...]
read-only, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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