predict method

double predict(
  1. double x
)

Predicts the y value for a given x.

Implementation

double predict(double x) => slope * x + intercept;