javascript illustration

How Can We Use Javascript in Data Science?

Jun 8, 2019

 

JavaScript, the most popular language for web development. Apart from that, can we use it for Data Science? In this blog post, I will share the use of JavaScript in my data scientist job and how you can use it to help you.

My Background

I have been actively involved in software development, database technologies, data mining, and analytics, for the past 20 years. Apart from analyzing data, I do need to use JavaScript to build products from time to time.

We use JavaScript for visualizations, asynchronous tasks, and handling real-time data. We use D3.js to create beautiful and interactive charts for users to explore complex business data.  We also use NodeJS plus SocketIO to handle real-time data. It might be counter-intuitive to use JavaScript as the language for data science tasks. JavaScript is playing a crucial part in entire data science workflow.

When does a data scientist use JavaScript ?

We use JavaScript for visualizations, asynchronous tasks, and handling real-time data. We use D3.js to create beautiful and interactive charts for users to explore complex business data.  We also use NodeJS plus SocketIO to handle real-time data. It might be counter-intuitive to use JavaScript as the language for data science tasks. JavaScript is playing a crucial part in entire data science workflow.

Most data scientists still prefer to use Python / R for conventional data science tasks. With the recent rise in machine learning, libraries like Tensorflow are already available in JS (https://js.tensorflow.org/). Now we already build ML models in browsers.

 

Any real-world use case that JavaScript helps in data science workflow?

Let’s use medical as an example. You are developing wearable devices and you want to collect users activity data. JavaScript runs on almost all platforms including wearables. Using JavaScript reduces compatibility issues, and it enables data scientists to collect data from medical devices and run algorithms in a streamlined fashion.

Why JavaScript over different modes such as Python?

Unless you have decided that you want to learn data science first, then you may learn Python or R first. Otherwise, I recommend JavaScript over other languages for beginners and startups.

JavaScript’s learning curve is not as steep, as we can use JavaScript for both client-side and server-side programming. NodeJS is efficient because of its single threaded event call back mechanism. That enables us to develop scalable real-time applications.

It’s all about picking the right tool for the right tasks. Although Python has developed a robust ecosystem of data science tools that help data scientists perform analytical work.

I believe that in the future, JavaScript will develop an ecosystem of data science tools of its own flavor in the near future.

Brought to you by

The LEAD team believes in growth. The question we ask every day: How can we help our students achieve more?

Get the scoop on the latest stuff.

Guides

Ultimate Guide to Data Science

Recent Posts

2 Comments

  1. Aman qureshi

    Instead of using JS for visualization now is it preferred to use tools like Power BI and Tabelau ?
    and if JS is replaced by these tools can we say JS is now mostly used for Tenserflow ?
    Specifically for Data Science.

    Reply
    • Dr. Lau

      Hi Aman,

      Using JS for visualization gives us a lot more controls from data loading strategies, customization, on-the-fly calculation, to other unique visualizations (https://d3js.org/) rather than just bar charts and pie charts. Power BI and Tableau are business intelligence tools, which still come in handy for business analysts and data analysts who are not so well-versed in JavaScript or programming. Tensorflow is just a deep learning platform. Although there are TensorFlow.js, the best-supported programming language for TF is still Python.

      Reply

Submit a Comment

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