Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@2.8.4/dist/tf.min.js"></script>
<body>
<h2>Fetch TensorFlow Data</h2>
<div id="demo"></div>
<script>
// Extract Correct Data 
function extractData(obj) {
  return {x:obj.Horsepower, y:obj.Miles_per_Gallon};
}
function removeErrors(obj) {
  return obj.x != null && obj.y != null;
}
// Main Function
async function runTF() {
const jsonData = await fetch("cardata.json");
let values = await jsonData.json();
values = values.map(extractData).filter(removeErrors);
// Display Data (for Quality Check)
let text = "";
for (let i = 0; i < values.length; i++) {
  text +=   "x: " + values[i].x + " y:" + values[i].y + "<br>";
} 
document.getElementById("demo").innerHTML = text;
// End Main Function
}
runTF();
</script>
</body>
</html>