Example #1
0
 assert.throws(function () {
     SVR.predict(new la.Vector([1]));
 });
Example #2
0
 assert.throws(function () {
     SVR.fit(matrix, vector);
 });
Example #3
0
 assert.doesNotThrow(function () {
     SVR.predict(vec2);
 });
Example #4
0
 it("should ignore extra parameters given to the function", function () {
     var SVR = new analytics.SVR({ algorithm: "LIBSVM" });
     var Model = SVR.getModel(1);
     assert.equal(Model.weights.length, 0);
     assert.equal(Model.bias, 0);
 })
Example #5
0
 assert.doesNotThrow(function () {
     SVR.fit(matrix, vector);
 });         
Example #6
0
 it("should return zero even if the parameters have been changed", function () {
     var SVR = new analytics.SVR({ algorithm: "LIBSVM" });
     SVR.setParams({ j: 3, maxTime: 2 });
     var num = SVR.bias;
     assert.equal(num, 0);
 })
Example #7
0
 it("should return parameters of the model", function () {
     var SVR = new analytics.SVR({ algorithm: "LIBSVM" });
     var Model = SVR.getModel();
     assert.equal(Model.weights.length, 0);
     assert.equal(Model.bias, 0);
 })
Example #8
0
 assert.throws(function () {
     SVR.setParams();
 });
Example #9
0
 it("should return an empty vector even if the parameters have been changed", function () {
     var SVR = new analytics.SVR({ algorithm: "LIBSVM" });
     SVR.setParams({ j: 3, maxTime: 2 });
     var Vec = SVR.weights;
     assert.equal(Vec.length, 0);
 })
Example #10
0
 assert.throws(function () {
     SVR.decisionFunction(matrix2);
 });
Example #11
0
 it("should throw an exception if there is no given argument", function () {
     var SVR = new analytics.SVR({ algorithm: "LIBSVM" });
     assert.throws(function () {
         SVR.setParams();
     });
 })
Example #12
0
 assert.throws(function () {
     SVR.decisionFunction(vec2);
 });
Example #13
0
 assert.doesNotThrow(function () {
     SVR.decisionFunction(vec2);
 })
Example #14
0
 assert.throws(function () {
     SVR.predict(mat2);
 });
Example #15
0
 assert.throws(function () {
     SVR.predict(vector);
 });
Example #16
0
 it("should throw an exception if the argument is not Json", function () {
     var SVR = new analytics.SVR();
     assert.throws(function () {
         SVR.setParams(1);
     });
 })