diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index bc57d11..0000000 --- a/.eslintrc.yml +++ /dev/null @@ -1 +0,0 @@ -extends: cheminfo-typescript diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..323e6c0 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,8 @@ +import cheminfo from 'eslint-config-cheminfo-typescript'; + +export default [ + ...cheminfo, + { + rules: {} + } +] \ No newline at end of file diff --git a/package.json b/package.json index 13084c4..5ab6bd5 100644 --- a/package.json +++ b/package.json @@ -36,18 +36,18 @@ }, "homepage": "https://github.com/mljs/regression-polynomial#readme", "devDependencies": { - "@vitest/coverage-v8": "^1.6.0", - "eslint": "^8.56.0", - "eslint-config-cheminfo-typescript": "^12.4.0", - "ml-spectra-processing": "^14.5.0", - "prettier": "^3.2.5", - "rimraf": "^5.0.7", - "typescript": "^5.4.5", - "vitest": "^1.6.0" + "@vitest/coverage-v8": "^2.1.3", + "eslint": "^9.12.0", + "eslint-config-cheminfo-typescript": "^16.0.0", + "ml-spectra-processing": "^14.6.0", + "prettier": "^3.3.3", + "rimraf": "^6.0.1", + "typescript": "^5.6.3", + "vitest": "^2.1.3" }, "dependencies": { - "cheminfo-types": "^1.7.3", - "ml-matrix": "^6.11.0", + "cheminfo-types": "^1.8.0", + "ml-matrix": "^6.12.0", "ml-regression-base": "^4.0.0" } } diff --git a/src/__tests__/test.test.ts b/src/__tests__/test.test.ts index f1b0a5d..d1f2f53 100644 --- a/src/__tests__/test.test.ts +++ b/src/__tests__/test.test.ts @@ -72,7 +72,7 @@ describe('Polynomial regression', () => { it('degree 5', () => { const x = [50, 50, 50, 70, 70, 70, 80, 80, 80, 90, 90, 90, 100, 100, 100]; const y = [ - 3.3, 2.8, 2.9, 2.3, 2.6, 2.1, 2.5, 2.9, 2.4, 3.0, 3.1, 2.8, 3.3, 3.5, 3.0, + 3.3, 2.8, 2.9, 2.3, 2.6, 2.1, 2.5, 2.9, 2.4, 3, 3.1, 2.8, 3.3, 3.5, 3, ]; const degree = 5; const regression = new PolynomialRegression(x, y, degree); diff --git a/src/index.ts b/src/index.ts index 83714d9..c3b22e6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,10 +18,10 @@ export class PolynomialRegression extends BaseRegression { * @param y - dependent or response variable * @param degree - degree of the polynomial regression, or array of powers to be used. When degree is an array, intercept at zero is forced to false/ignored. * @example `new PolynomialRegression(x, y, 2)`, in this case, you can pass the option `interceptAtZero`, if you need it. + * @param options * @example `new PolynomialRegression(x, y, [1, 3, 5])` * Each of the degrees corresponds to a column, so if you have them switched, just do: * @example `new PolynomialRegression(x, y, [3, 1, 5])` - * * @param options.interceptAtZero - force the polynomial regression so that f(0) = 0 */ constructor( @@ -129,6 +129,7 @@ export class PolynomialRegression extends BaseRegression { * @param y - dependent or response variable * @param degree - degree of the polynomial regression * @param options.interceptAtZero - force the polynomial regression so that $f(0) = 0$ + * @param options */ function regress( x: NumberArray,