-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Context:
While trying to cover tests for WASM loaded SVM's predict
, I've encountered an issue of incorrect prediction results between running a test by itself vs running tests in-band.
Problematic test:
it('should predict bodyfat scale dataset using C_SVC and LINEAR', () => {
const rawData = fs.readFileSync(path.join(__dirname, '../samples/bodyfat_scale.txt'), 'utf-8');
const data = rawData.split('\n').map((line) => line.split(' ').filter((el) => el));
const labels = data.map((line) => +line.splice(0, 1)[0]);
const features = data.map((line) => line.map((el) => +el.split(':')[1]));
const svm = new SVM({
type: SVMTypes.C_SVC,
kernel: KernelTypes.LINEAR,
epsilon: 0.001,
quiet: true,
probabilityEstimates: true,
});
return svm.loadWASM().then((loadedSVM) => {
loadedSVM.train({ samples: features, labels });
const predResult = loadedSVM.predict({
samples: [features[0], features[1]],
});
loadedSVM.free();
// TODO: It seems like other tests are influencing the result of this.
// I don't know why so far, we should figure it out
expect(predResult).toEqual([1, 1]);
});
});
When you run this test on its own, it passes without an issue since the loadedSVM
instance is isolated. However, if you run this test in parallel/sequentially along with other tests, the prediction starts to return different values.
We should investigate why this is happening and devise a solution.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed