Transforming and normalizing data

The most common preprocessing task is to transform and/or normalize data into a representation that can be used by your algorithm. For instance, you may receive JSON objects from an API endpoint that you need to transform into vectors used by your algorithm. Consider the following JSON data:

const users = [     {       "name": "Andrew",       "followers": 27304,       "posts": 34,       "images": 38,       "engagements": 2343,       "is_verified": false     },     {       "name": "Bailey",       "followers": 32102,       "posts": 54,       "images": 102,       "engagements": 9488,       "is_verified": true     },     {       "name": "Caroline",       "followers": 19932,       "posts": 12,       "images": 0,       "engagements": 19,       "is_verified": false     }];

Your neural network that processes the data expects input data in vector ...

Get Hands-on Machine Learning with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.