Is Javascript Good For Machine Learning?

by Silvia Mazzetta Date: 16-06-2020 machinelearning AI ArtificialIntelligence javascript


One of the things you always hear when you are talking to someone related to the M.L. world is that, one must learn Python because the vast majority of the major libraries are in that technology. You're probably right, but I chose JavaScript as the metal of my sword and decided to find out a bit about this statement and write a bit about it in case you ever wondered about it too.

Can I do Machine Learning with JavaScript ?


The short answer is yes.

You don't have to be a genius to know that if Google is working on https://js.tensorflow.org/, which is one of the most popular AI libraries in the industry, it's because they've already looked at the benefits and disadvantages of using JavaScript over Python.
But the purpose is to explore a little more about the current state of Machine Learning with JavaScript.

But what is Machine Learning?
To answer this you can read my previous post.

Some things that are said about JavaScript and the M.L.

- Javascript is slow.
- Handling Matrices is difficult with JavaScript.
- Python got all the major libraries.

Let's analyze these statements one by one.

JavaScript is slow.

Short answer: It depends.
First we have to understand that JavaScript can run both in a browser (Client) which its CPU and memory capacity will be variable and can run in the Server with something called Node.js in which we will have a computer with the capabilities we have chosen in our Server.

The second thing is that a developer without a deep understanding of JavaScript in both design and architecture and best practices can create something of poor performance in any technology. You can find good performance concepts in these technologies in this JavaScript link in the Client and in this JavaScript link in the Server.

Handling Matrices is difficult with JavaScript.

Well, doing a lot of things in JavaScript is difficult because of the freedom it gives to developers, to the point of being able to extend the language itself through polyfills, but this has never been a problem, because being one of the most popular technologies in the world according to StackOverflow there are always one or two libraries that can help you with that.

You can take a look at math.js to see that already manipulating arrays becomes a little more friendly ;)

Python got all the major libraries.

Yes. all the important libraries for M.L. in which much of the study and research has been done, are made in Python. Like Tensorflow and scikit-learn but that doesn't let you find good options like:

- brain.js for neural networks.
- Natural for natural language processing.
- TensorflowJs for model training
- Webdnn for deep learning.

What is possible with Machine Learning and JavaScript?

Presciently, many developers are moving from handling ML on back-end servers to front-end applications.

And thanks to TensorFlow.js, teams can now create and run ML models in static HTML documents without ever setting up a server or even database — enabling the following services, hosted entirely client-side.

  • Automatic Picture Manipulation: auto-adjust images based on a predefined rule-set using a browser-based application — even generate art using convolutional neural networks, as Google has done.
  • Offline Game Opponents: play against an AI-operated adversary, even when a video game is offline.
  • Content Recommendation Engine: build and train an ML algorithm in the browser, identifying what users like to look at and surfacing more relevant content — just as Twitter have done to rank tweets.
  • Activity Monitoring: install a client-side application that learns usage patterns on a local network or device — to monitor and flag unusual activity.
  • Object Detection: use a client-side application to detect documents or objects in pictures — such as Airbnb uses to alert users to the presence of sensitive information when they upload a passport or driving license photo.

Still, an increasing number of companies are experimenting with machine learning applications that run on the end-users’ device. And as devices get more powerful, the opportunity to experiment will only grow.

If you’re sat there questioning whether JavaScript for machine learning is fad or fashion, experience and popularity suggest its a trend that’s only set to grow.

 
by Silvia Mazzetta Date: 16-06-2020 machinelearning AI ArtificialIntelligence javascript hits : 4648  
 
Silvia Mazzetta

Silvia Mazzetta

Web Developer, Blogger, Creative Thinker, Social media enthusiast, Italian expat in Spain, mom of little 6 years old geek, founder of  @manoweb. A strong conceptual and creative thinker who has a keen interest in all things relate to the Internet. A technically savvy web developer, who has multiple  years of website design expertise behind her.  She turns conceptual ideas into highly creative visual digital products. 

 
 
 

Related Posts

    What is Machine Learning ?

    Artificial Intelligence or AI is a trend in technology and has been the main topic of many philosophical debates as to where this field will lead us as humanity. This time…

    10 libraries for machine learning in JavaScript

    JavaScript is currently one of the most popular programming languages. Its main application is in web applications, used to give functionality to dynamic web pages. Another field in which it…

    Ideas shaping web design today

    Web design in order to succeed needs two things: innovation and imitation. Unfortunately, the last one often wins. Web designers love to learn, study and use the latest trends, and then…

    A Year Later, What Google Drive Means for Startups

    A year ago, we were a launch partner when Google unveiled Drive. Much has been made of what this means for Google or the cloud storage wars, but there’s been…