Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: isair/tensorflow-load-csv
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 55d08b8096fb63d8bc088b8630ada0965e5ae1a0
Choose a base ref
..
head repository: isair/tensorflow-load-csv
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 632ac2902c1618c19eab79bd6e9672c14752de24
Choose a head ref
Showing with 267 additions and 101 deletions.
  1. +1 −0 .gitignore
  2. +4 −0 README.md
  3. +183 −96 package-lock.json
  4. +22 −0 src/applyMappings.ts
  5. +7 −0 src/loadCsv.models.ts
  6. +6 −2 src/loadCsv.ts
  7. +38 −0 tests/applyMappings.test.ts
  8. +6 −3 tests/loadCsv.test.ts
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -24,3 +24,4 @@ pnpm-debug.log*
dist
docs
coverage
shrinkwrap.yaml
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -55,6 +55,10 @@ const {
} = loadCsv('./data.csv', {
featureColumns: ['lat', 'lng', 'height'],
labelColumns: ['temperature'],
mappings: {
height: (ft) => ft * 0.3048, // feet to meters
temperature: (f) => (f - 32) / 1.8, // fahrenheit to celsius
}, // Map values based on which column they are in before they are loaded into tensors.
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.
prependOnes: true, // Prepends a column of 1s to your features and testFeatures tensors, useful for linear regression.
Loading