Example #1
0
        it('should serialize and deserialize', function () {
            var matrix = new la.Matrix([[1, -1], [0, 0]]);
            var vec = new la.Vector([1, -1]);
            var SVC = new analytics.SVC();
            SVC.fit(matrix, vec);
			SVC.save(require('qminer').fs.openWrite('svr_test.bin')).close();
            var SVC2 = new analytics.SVC(require('qminer').fs.openRead('svr_test.bin'));
            assert.deepEqual(SVC.getParams(), SVC2.getParams());
            assert.eqtol(SVC.weights.minus(SVC2.weights).norm(), 0, 1e-8);
        })