Skip to content

Conversation

@jazeee
Copy link

@jazeee jazeee commented Jan 1, 2020

Add residuals prop.
Upgrade babel and build process.
Update README
Lint fix

Upgrade babel and build process.
Update README
Lint fix
Copy link
Author

@jazeee jazeee left a 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/**",
Copy link
Author

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",
Copy link
Author

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) => ([
Copy link
Author

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


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]]);
Copy link
Author

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);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn lint --fix

Copy link
Author

@jazeee jazeee left a 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"
Copy link
Author

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');
Copy link
Author

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

@jazeee jazeee force-pushed the master branch 2 times, most recently from cf79570 to 1a90d06 Compare January 1, 2020 02:03
Move common code to utils.js
Update node version in Travis config to work with  Travis CI.
@jazeee
Copy link
Author

jazeee commented Jan 23, 2020

Pulled out the build upgrades from this code and in to PR #103

@jazeee jazeee deleted the branch Tom-Alexander:master May 10, 2024 18:12
@jazeee jazeee closed this May 10, 2024
@jazeee jazeee deleted the master branch May 10, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants