js-regression icon indicating copy to clipboard operation
js-regression copied to clipboard

Return the equation of the curve.

Open andrewoficial opened this issue 5 years ago • 1 comments

Would like to be able to get the equation of the curve that was calculated. Or the coefficients of the polynomials used to build the curve.

изображение изображение

andrewoficial avatar Aug 19 '20 12:08 andrewoficial

Have you tried logging the model you've generated? That's how I was able to get coefficients for the logistic regression at least.

I fit the model first to my training dataset and then I logged the model.

let model = logistic.fit(training_dataset);
console.log(model);

This outputted (obviously you will have values instead of '...'):

{
  theta: [ ... ], // these are your coefficients.
  threshold: 1,
  cost: ...,
  config: { alpha: 0.001, lambda: 0, iterations: 10000 }
}

henryjburg avatar Dec 17 '20 04:12 henryjburg