fromScalarLists<S extends num> static method

TensorPairs<Tensor<double>> fromScalarLists<S extends num>(
  1. Iterable<S> x,
  2. Iterable<S> y
)

Constructs TensorPairs from two lists of int or double values.

Example

import 'package:calc/calc.dart';

void main() {
  final pairs = TensorPairs.fromScalars([1,2,3], [2,3,4]);
  final correlation = pairs.correlation().toScalar();
}

Implementation

static TensorPairs<Tensor<double>> fromScalarLists<S extends num>(
    Iterable<S> x, Iterable<S> y) {
  return TensorPairs.fromTensorLists(
    x.toTensors().toList(),
    y.toTensors().toList(),
  );
}