Skip to content

Instantly share code, notes, and snippets.

@Rishit-dagli
Created March 31, 2020 13:34
Show Gist options
  • Save Rishit-dagli/ae08f11caf9d6e9ad3516dff158d2892 to your computer and use it in GitHub Desktop.
Save Rishit-dagli/ae08f11caf9d6e9ad3516dff158d2892 to your computer and use it in GitHub Desktop.
Scatterplot of data
async function run() {
// Load and plot the original input data that we are going to train on.
const data = await getData();
const values = data.map(d => ({
x: d.horsepower,
y: d.mpg,
}));
tfvis.render.scatterplot(
{name: 'Horsepower v MPG'},
{values},
{
xLabel: 'Horsepower',
yLabel: 'MPG',
height: 300
}
);
// More code will be added below
}
document.addEventListener('DOMContentLoaded', run);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment