Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove define & add testcase sample. #10

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,14 @@ pip-log.txt

# Mac crap
.DS_Store
.idea

node_modules
coverage

map/tool
theme/thumb
/lib
todo
**/*.log

27 changes: 27 additions & 0 deletions __tests__/regression.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Created by hustcc on 18/3/13.
* Contract: [email protected]
*/

var ecStat = require('../');

/**
* test cases for regression
*/
describe('regression', function() {
test('linear regression', function() {
var data = [
[1, 2],
[3, 5]
];
var myRegression = ecStat.regression('linear', data);
expect(myRegression).toEqual({
expression: 'y = 1.5x + 0.5',
parameter: {
gradient: 1.5,
intercept: 0.5
},
points: [[1, 2], [3, 5]]
});
});
});
Loading