From 1e72a05082428bfbab526604fa83b8fc4989362a Mon Sep 17 00:00:00 2001 From: ishii-norimi Date: Sat, 8 Nov 2025 13:41:53 +0900 Subject: [PATCH 1/2] Fix some lint error --- tests/js/data/loader/image.test.js | 2 +- tests/lib/model/budget_perceptron.test.js | 2 +- tests/lib/model/co_training.test.js | 6 +++--- tests/lib/model/denclue.test.js | 1 - tests/lib/model/self_training.test.js | 5 ++--- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/js/data/loader/image.test.js b/tests/js/data/loader/image.test.js index c3a195c4..cb073a08 100644 --- a/tests/js/data/loader/image.test.js +++ b/tests/js/data/loader/image.test.js @@ -276,7 +276,7 @@ describe('ImageLoader', () => { } }) - test('not normalize', () => { + test('with threshold', () => { const imdata = [] for (let i = 0; i < 50; i++) { imdata[i] = [] diff --git a/tests/lib/model/budget_perceptron.test.js b/tests/lib/model/budget_perceptron.test.js index e89a3d65..4b4a057b 100644 --- a/tests/lib/model/budget_perceptron.test.js +++ b/tests/lib/model/budget_perceptron.test.js @@ -18,7 +18,7 @@ test.each([undefined, 0, 2])('fit %i', n => { expect(acc).toBeGreaterThan(0.95) }) -test.only.each([0, 2])('fit replace sv n: %p', n => { +test.each([0, 2])('fit replace sv n: %p', n => { const model = new BudgetPerceptron(1, n) const x = [ [0.44, 0.43], diff --git a/tests/lib/model/co_training.test.js b/tests/lib/model/co_training.test.js index ea219b2f..ec90efae 100644 --- a/tests/lib/model/co_training.test.js +++ b/tests/lib/model/co_training.test.js @@ -81,14 +81,14 @@ test('semi-classifier', () => { test('semi-classifier not categorized', () => { const model = new CoTraining( { - fit(x, y) {}, + fit() {}, predict(x) { - return x.map(v => ({ category: 0, score: 0 })) + return x.map(() => ({ category: 0, score: 0 })) }, threshold: 0.5, }, { - fit(x, y) {}, + fit() {}, predict(x) { return x.map(() => ({ category: 0, score: 0 })) }, diff --git a/tests/lib/model/denclue.test.js b/tests/lib/model/denclue.test.js index 41bae894..d4525b1b 100644 --- a/tests/lib/model/denclue.test.js +++ b/tests/lib/model/denclue.test.js @@ -81,7 +81,6 @@ describe('clustering', () => { test('large h', () => { const model = new DENCLUE(1e6) - const n = 50 const x = [ [0, 0], [1, 1], diff --git a/tests/lib/model/self_training.test.js b/tests/lib/model/self_training.test.js index 48ed5cf4..c5da46b0 100644 --- a/tests/lib/model/self_training.test.js +++ b/tests/lib/model/self_training.test.js @@ -47,11 +47,10 @@ test('semi-classifier', () => { expect(acc).toBeGreaterThan(0.95) }) -test('semi-classifier', () => { - const dt = new DecisionTreeClassifier('CART') +test('semi-classifier not categorized', () => { const model = new SelfTraining( { - fit(x, y) {}, + fit() {}, predict(x) { return x.map(() => ({ category: 0, score: 0 })) }, From 19dbba46981e78882fa7d3528be97577d2ccf841 Mon Sep 17 00:00:00 2001 From: ishii-norimi Date: Sat, 8 Nov 2025 14:38:16 +0900 Subject: [PATCH 2/2] Remove unused import of loadTensor from shape.js --- lib/model/nns/onnx/operators/shape.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/model/nns/onnx/operators/shape.js b/lib/model/nns/onnx/operators/shape.js index aeeca516..b5df7123 100644 --- a/lib/model/nns/onnx/operators/shape.js +++ b/lib/model/nns/onnx/operators/shape.js @@ -1,5 +1,5 @@ import { onnx } from '../onnx_importer.js' -import { loadTensor, loadAttribute } from '../utils.js' +import { loadAttribute } from '../utils.js' /** * Handle shape operator