MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / loadCsv

Function loadCsv

boston-housing/data.js:53–66  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

51 * @returns {Promise.Array<number[]>} Resolves to parsed csv data.
52 */
53export const loadCsv = async (filename) => {
54 return new Promise(resolve => {
55 const url = `${BASE_URL}${filename}`;
56
57 console.log(` * Downloading data from: ${url}`);
58 Papa.parse(url, {
59 download: true,
60 header: true,
61 complete: (results) => {
62 resolve(parseCsv(results['data']));
63 }
64 })
65 });
66};
67
68/** Helper class to handle loading training and test data. */
69export class BostonHousingDataset {

Callers 1

loadDataMethod · 0.70

Calls 1

parseCsvFunction · 0.70

Tested by

no test coverage detected