js-regression
js-regression copied to clipboard
Return the equation of the curve.
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.

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 }
}