Skip to content

Commit

Permalink
improve the unit testing coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
chen0040 committed May 26, 2017
1 parent 03a2746 commit a2fe60d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/linear-regression-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ describe("Test linear regression", function() {
expect(intercept).to.above(0.0);
});

it("can transform multiple rows of data", function(){
var Y_predicted = regression.transform(data);
expect(Y_predicted.length).to.equal(data.length);
});

});
});

5 changes: 5 additions & 0 deletions test/logistic-regression-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,10 @@ describe("Test logistic regression", function(){
it('should have a cost of lower than 0.5', function(){
expect(result.cost).to.below(0.6);
});

it("can transform multiple rows of data", function(){
var Y_predicted = logistic.transform(testingData);
expect(Y_predicted.length).to.equal(testingData.length);
});
});
});
5 changes: 5 additions & 0 deletions test/multi-class-logistic-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,10 @@ describe("Test multi-class classification using logistic regression", function()
}

});

it("can transform multiple rows of data", function(){
var Y_predicted = classifier.transform(testingData);
expect(Y_predicted.length).to.equal(testingData.length);
});
});
});

0 comments on commit a2fe60d

Please sign in to comment.