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

Function loadCsv

website-phishing/utils.js:46–59  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

44 * @returns {Promise.Array<number[]>} Resolves to parsed csv data.
45 */
46export async function loadCsv(filename) {
47 return new Promise(resolve => {
48 const url = `${BASE_URL}${filename}.csv`;
49
50 console.log(` * Downloading data from: ${url}`);
51 Papa.parse(url, {
52 download: true,
53 header: true,
54 complete: (results) => {
55 resolve(parseCsv(results['data']));
56 }
57 })
58 });
59};
60
61/**
62 * Shuffles data and label using Fisher-Yates algorithm.

Callers

nothing calls this directly

Calls 1

parseCsvFunction · 0.70

Tested by

no test coverage detected