Logarithmic Regression use ln
$ npm i ml-regression-logarithmic
This calculates parameters A and B for the equation f(x) = A + B * ln(x)
.
import { LogarithmicRegression } from 'ml-regression-logarithmic';
const { LogarithmicRegression } = require('ml-regression-logarithmic');
const x = [1.5, 2.5, 3.5, 5.0, 7.5];
const y = [0, 1, 2, 3, 4];
const regression = new LogarithmicRegression(x, y);