Add residuals prop, upgrade packages#101
Closed
jazeee wants to merge 2 commits intoTom-Alexander:masterfrom
Closed
Add residuals prop, upgrade packages#101jazeee wants to merge 2 commits intoTom-Alexander:masterfrom
residuals prop, upgrade packages#101jazeee wants to merge 2 commits intoTom-Alexander:masterfrom
Conversation
Upgrade babel and build process. Update README Lint fix
jazeee
commented
Jan 1, 2020
| ], | ||
| "scripts": { | ||
| "clean": "rm -rf dist && mkdir dist", | ||
| "lint": "./node_modules/.bin/eslint src/** tests/**", |
Author
There was a problem hiding this comment.
./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", |
Author
There was a problem hiding this comment.
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) => ([ |
Author
There was a problem hiding this comment.
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]]); |
| describe(name, () => { | ||
| it(`correctly predicts ${name}`, () => { | ||
| let result = regression[model](example.data, example.config); | ||
| const result = regression[model](example.data, example.config); |
jazeee
commented
Jan 1, 2020
.travis.yml
Outdated
| language: node_js | ||
| node_js: | ||
| - "6.1" | ||
| - "8.0.0" |
| @@ -1,41 +1,6 @@ | |||
| const DEFAULT_OPTIONS = { order: 2, precision: 2, period: null }; | |||
| const { round, deriveDataProperties } = require('./utils'); | |||
Author
There was a problem hiding this comment.
CI tests complained about this file being too big, and that there was duplicate code.
Moved that to utils.js
cf79570 to
1a90d06
Compare
Author
|
Pulled out the build upgrades from this code and in to PR #103 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
residualsprop.Upgrade babel and build process.
Update README
Lint fix