-
Notifications
You must be signed in to change notification settings - Fork 127
Add residuals prop, upgrade packages
#101
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
Conversation
Upgrade babel and build process. Update README Lint fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LMK if this looks fine.
| ], | ||
| "scripts": { | ||
| "clean": "rm -rf dist && mkdir dist", | ||
| "lint": "./node_modules/.bin/eslint src/** tests/**", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./node_modules/.bin prefix is unneeded.
Oddly, tests was incorrect - the path was test. This broke linting... (maybe latest eslint is more strict)
| "lint": "./node_modules/.bin/eslint src/** tests/**", | ||
| "test": "npm run lint && ./node_modules/.bin/nyc --reporter=lcov ./node_modules/.bin/mocha --compilers js:babel-core/register", | ||
| "lint": "eslint src/** test/**", | ||
| "test": "npm run lint && nyc --reporter=lcov mocha --require @babel/register", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgrade to babel and mocha deprecated --compilers
| const intercept = round((sum[1] / len) - ((gradient * sum[0]) / len), options.precision); | ||
|
|
||
| const predict = x => ([ | ||
| const predict = (x) => ([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically fixed with yarn lint --fix
src/regression.js
Outdated
|
|
||
| const points = data.map(point => predict(point[0])); | ||
| const points = data.map((point) => predict(point[0])); | ||
| const residuals = points.map((point, index) => [point[0], point[1] - data[index][1]]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New functionality...
| describe(name, () => { | ||
| it(`correctly predicts ${name}`, () => { | ||
| let result = regression[model](example.data, example.config); | ||
| const result = regression[model](example.data, example.config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn lint --fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LMK if this looks fine.
.travis.yml
Outdated
| language: node_js | ||
| node_js: | ||
| - "6.1" | ||
| - "8.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Travis complained about 6.1
| @@ -1,41 +1,6 @@ | |||
| const DEFAULT_OPTIONS = { order: 2, precision: 2, period: null }; | |||
| const { round, deriveDataProperties } = require('./utils'); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI tests complained about this file being too big, and that there was duplicate code.
Moved that to utils.js
cf79570 to
1a90d06
Compare
|
Pulled out the build upgrades from this code and in to PR #103 |
Add
residualsprop.Upgrade babel and build process.
Update README
Lint fix