Tutorials References Menu

TensorFlow Example 2

Input Data

Reduce Loss


Explained

Example 2 uses the same source code as Example 1.

Except: The data used in this example, is a list of house objects:

{
"Avg. Area Income": 79545.45857,
"Avg. Area House Age": 5.682861322,
"AvgAreaNumberofRooms": 7.009188143,
"Avg. Area Number of Bedrooms": 4.09,
"Area Population": 23086.8005,
"Price": 1059033.558,
},
{
"Avg. Area Income": 79248.64245,
"Avg. Area House Age": 6.002899808,
"AvgAreaNumberofRooms": 6.730821019,
"Avg. Area Number of Bedrooms": 3.09,
"Area Population": 40173.07217,
"Price": 1505890.915,
},

The dataset is a JSON file stored at:

https://github.com/meetnandu05/ml1/blob/master/house.json

Because another dataset is used, the code must extract other data:

function extractData(obj) {
  return {x:obj.AvgAreaNumberofRooms, y:obj.Price};
}

Try it Yourself »