Skip to content

Commit

Permalink
feat(lib): Support mapping a column to multiple columns (#189)
Browse files Browse the repository at this point in the history
* feat(lib): Support mapping a column to multiple columns

Extremely useful for classification.

* test(lib): Resolve flattening test flakiness

* ci(config): Integrate with Mergeable

* ci(config): Integrate with Dependabot

* build(deps-dev): Fix security issues

* docs(lib): Add flatten to advanced usage example
  • Loading branch information
isair authored Mar 3, 2021
1 parent e504478 commit c75eb6f
Show file tree
Hide file tree
Showing 18 changed files with 672 additions and 3,098 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = {
'newlines-between': 'always',
},
],
'sonarjs/cognitive-complexity': ['error', 18],
},
overrides: [
{
Expand Down
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
# Fetch and update latest `npm` packages
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- isair
assignees:
- isair
36 changes: 36 additions & 0 deletions .github/mergeable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 2
mergeable:
- when: pull_request.*
validate:
- do: assignee
min:
count: 1
- do: approvals
min:
count: 1
block:
changes_requested: true
- do: title
must_include:
regex: '^[a-z]+\([a-z-]+\): [A-Z]{1}(.+)$'
- do: dependent
changed:
file: 'package.json'
required: ['package-lock.json']

- when: schedule.repository
validate:
- do: stale
days: 20
type: pull_request, issues
pass:
- do: comment
payload:
body: This is old. Is it still relevant?

- when: pull_request.*, pull_request_review.*, status.*, check_suite.*
name: 'Automatically merge pull requests once it passes all checks'
validate: []
pass:
- do: merge
merge_method: 'squash'
24 changes: 0 additions & 24 deletions .github/workflows/check-pr.yml

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ const {
labelColumns: ['temperature'],
mappings: {
height: (ft) => ft * 0.3048, // feet to meters
temperature: (f) => (f - 32) / 1.8, // fahrenheit to celsius
temperature: (f) => (f < 50 ? [1, 0] : [0, 1]), // cold or hot classification
}, // Map values based on which column they are in before they are loaded into tensors.
flatten: ['temperature'], // Flattens the array result of a mapping so that each member is a new column.
shuffle: true, // Pass true to shuffle with a fixed seed, or a string to use it as a seed for the shuffling.
splitTest: true, // Splits your data in half. You can also provide a certain row count for the test data, or a percentage string (e.g. 10%).
prependOnes: true, // Prepends a column of 1s to your features and testFeatures tensors, useful for linear regression.
Expand Down
Empty file added assets/csv/empty.csv
Empty file.
1 change: 1 addition & 0 deletions assets/csv/headers.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test,headers,should,fail
2 changes: 1 addition & 1 deletion commitlint.scopes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = [
'github',
'script',
'deps',
'dev-deps',
'deps-dev',
'asset',
'lib',
'release',
Expand Down
40 changes: 0 additions & 40 deletions dangerfile.ts

This file was deleted.

Loading

0 comments on commit c75eb6f

Please sign in to comment.