šŸŽ Checkout my Learn React by Making a Game course and get 1 month Free on Skillshare!

A brief explanation of Machine Learning for Javascript developers

The machine learning term was coined in 1959 by Arthur Samuel, an IBM researcher.

Before we start, Please note that this article aims only to provide a very shallow intro to what machine learning is. We will only scratch the surface without going into too many details.

What is Machine Learning

Machine learning refers to a process where we teach a computer how to perform a task without explicitly programming it to perform that task.

Instead of the classical programming way to do things in machine learning, we are feeding data to an algorithm so that we gradually improve outcomes based on multiple experiences.

Compared with the classic way of programming where we write a function and give it an input to generate the output, in machine learning, we try to deduct that function based on a huge set of inputs and outputs. Wrote more about this here.

Main tasks for Machine Learning

There are two main tasks that are handled by machine learning:

  • data classification; for example determining what object is shown in a picture, or face recognition
  • predictions for future outcomes based on older data; for example price evolution, what youtube video do you want to watch next or product recommendations

Steps in the Machine Learning process

There are a set of preferred septs we need to go through when setting up a machine learning process.

STEP 1: gather data and clean it up. The more data, the better. Also the data quality matters. The better the given data represents the problem, the better the results. The data needs to have some kinds of signals that the algorithm can use to generate solutions. There is a process called feature engineering where the raw initial data is transformed into features that better represent the underlying problem.

STEP 2: The next step is to separate the data into a training set and a testing set. The average weight is somewhere around 80% of the data goes in the training set while the rest of the 20% goes to the testing data.

We first pass the training data to the algorithm to build a model. When the model is ready we can use the testing data to assert how well the resulting model behaves in the real world. Expect each model to have a level of error.

STEP 3: the final step is to choose an algorithm. Such algorithms can be:

  • statistic LiniarRegresion or LogisticRegresions
  • DecisionTrees that work by assigning different weights to the data features
  • Convolutional neuronal networks assign weights to features but also create features automatically for things like natural language processing or images where manual feature engineering is impossible

Each of these functions improves by comparing its predictions to an error function.

Models, the Deliverables of Machine Learning

The end result of a machine learning process is a model. Basically, the model is just a file that takes as input any data with the format that the model was trained on and gives as output a prediction.

That model can be later embedded on a phone or used in the browser with tools such as TensorflowJs.

As a funny ending fact, it seems that Arthur Samuel established the basic rules of Machine Learning while trying to find a way to make the computer play checkers. I've also started programming while trying to make my own games. One extra evidence that video games are not bad for us šŸ™‚

Next, you can take a look at how to make your first machine-learning app with Javascript and TensorflowJs.

šŸ“– 50 Javascript, React and NextJs Projects

Learn by doing with this FREE ebook! Not sure what to build? Dive in with 50 projects with project briefs and wireframes! Choose from 8 project categories and get started right away.

šŸ“– 50 Javascript, React and NextJs Projects

Learn by doing with this FREE ebook! Not sure what to build? Dive in with 50 projects with project briefs and wireframes! Choose from 8 project categories and get started right away.


Leave a Reply

Your email address will not be published. Required fields are marked *