当前位置: 首页 > 工具软件 > Napa.js > 使用案例 >

数据科学家应该学习JavaScript吗?

龙佐
2023-12-01

使用Web的1种语言进行数据科学的利弊 (The pros and cons of using the web’s 1 language for data science)

If you have been following the tech landscape in recent years, you have probably noticed at least two things.

如果您最近几年一直关注技术领域,则可能已经注意到至少两件事。

For one, you may have noticed that JavaScript is a very popular language these days. It has been growing in popularity ever since Node.js allowed JavaScript developers to write server-side code.

首先,您可能已经注意到JavaScript是当今非常流行的语言 。 自从Node.js允许JavaScript开发人员编写服务器端代码以来,它已经越来越流行。

More recently, frameworks such as Electron, Cordova and React-Native have enabled JavaScript developers to build native apps across a wide range of platforms.

最近,诸如ElectronCordovaReact-Native之类的框架使JavaScript开发人员能够跨各种平台构建本机应用程序。

You’ve probably also noticed there is a lot of excitement surrounding the field of data science, especially machine learning. Recent advances in theory and technology have made this once-esoteric field much more accessible to developers.

您可能还已经注意到,数据科学领域尤其是机器学习领域引起了很多兴奋。 理论和技术方面的最新进展使这个曾经深奥的领域对于开发人员而言更加容易使用。

You might ask, then, whether they make a natural pairing? Should data scientists consider learning JavaScript?

那么,您可能会问,它们是否自然配对? 数据科学家应该考虑学习JavaScript吗?

Most data scientists work with some combination of Python, R and SQL. If you are new to the field, these are the languages you should master first.

大多数数据科学家都使用Python,R和SQL的某种组合。 如果您不熟悉该领域, 则应首先掌握这些语言

Data scientists may also specialize in another language such as Scala, or Java. There are many reasons why these languages are so popular.

数据科学家还可能专门研究另一种语言,例如Scala或Java。 这些语言如此受欢迎的原因很多

But relatively few data scientists specialize in JavaScript.

但是,很少有数据科学家专门研究JavaScript。

However, given JavaScript’s ubiquity and data science’s popularity, how much could data scientists benefit from learning even the basics of the language? And how about JavaScript developers who want to explore data science?

但是,考虑到JavaScript的无处不在和数据科学的普及,即使是学习该语言的基础知识,数据科学家也能从中受益多少呢? 想要探索数据科学JavaScript开发人员又如何呢?

Let’s start by looking at some important objections, then review some arguments in favour.

让我们先看一些重要的反对意见,然后再看一些赞成的论点。

反对 (Against)

  • Functionality — JavaScript just doesn’t have the range of data science packages and inbuilt functionality compared to languages such as R and Python. If you don’t mind reinventing the wheel, this might be less of an issue. But if you need to run more sophisticated analyses, you’ll run out of options pretty quick.

    功能性 —与R和Python等语言相比,JavaScript只是没有数据科学软件包和内置功能的范围。 如果您不介意重新发明轮子,那么这可能不是一个大问题。 但是,如果您需要运行更复杂的分析,则会很快用尽所有选项。

  • Productivity — Another advantage of Python and R’s extensive ecosystems is there are many guides and how-to’s available for almost any data science task you wish to do. For JavaScript, this is not really the case. You will probably take longer figuring out how to solve a data science problem in JavaScript than you would in Python or R.

    生产力 -Python和R广泛的生态系统的另一个优势是,对于您希望执行的几乎所有数据科学任务,都有许多指南和方法指南。 对于JavaScript,情况并非如此。 与使用Python或R相比,您可能需要花费更多的时间才能弄清楚如何用JavaScript解决数据科学问题。

  • Multithreading — It is often helpful to process large data sets or run simulations in parallel. However, Node.js is not suited for computationally intensive, CPU-bound tasks. For such tasks, languages such as Python, Java or Scala have the upper hand over JS. But, check out Microsoft’s Napa.js project. It provides a multithreaded JavaScript runtime that can complement Node.js.

    多线程 —处理大型数据集或并行运行模拟通常很有帮助。 但是,Node.js不适合计算密集型,CPU密集型任务。 对于此类任务,诸如Python,Java或Scala之类的语言优先于JS。 但是,请查看Microsoft的Napa.js项目 。 它提供了一个多线程JavaScript运行时,可以补充Node.js。

  • Opportunity cost — Perhaps the main reason data scientists tend not to learn many languages beyond Python and R is due to ‘opportunity cost’. Every hour spent learning another language is an hour that could have been invested in learning a new Python framework, or another R library. While these languages dominate the data science job market, there is more incentive to learn them. And because data science is such a fast-moving field, there’s always something new to learn.

    机会成本 -也许数据科学家倾向于不学习Python和R以外的许多语言的主要原因是由于“ 机会成本 ”。 学习另一种语言所花费的每个小时,本来可以用来学习新的Python框架或另一个R库的一个小时。 尽管这些语言在数据科学工作市场上占主导地位,但有更多的动机去学习它们。 而且由于数据科学是一个快速发展的领域,因此总会有一些新东西需要学习。

对于 (For)

  • Visualization — JavaScript excels at data visualization. Libraries such as D3.js, Chart.js, Plotly.js and many others make powerful data visualization and dashboards really easy to build. Check out some great D3 examples!

    可视化 -JavaScript擅长数据可视化。 D3.jsChart.jsPlotly.js等库和许多其他库使强大的数据可视化和仪表板真正易于构建。 看看一些很棒的D3示例

  • Product integration — More and more companies are using web technologies with a Node-based stack to build their core product or service. If your role as a data scientist requires you to work closely with product developers, then it cannot hurt to ‘speak’ the same language.

    产品集成 —越来越多的公司正在将Web技术与基于Node的堆栈一起使用来构建其核心产品或服务。 如果您作为数据科学家的角色要求您与产品开发人员紧密合作,那么“说”相同的语言就不会有伤害。

  • ETL — Data processing pipelines are usually implemented in a general purpose language, like Python, Scala or Java. JavaScript often doesn’t get a look in. However, this might be unfair. Node’s filesystem module ‘fs’ provides a great API which lets you call standard filesystem operations either synchronously or asynchronously. Node also plays along nicely with MongoDB and many other popular database systems. The Streams API makes it very easy to work with streams of large data — another potential advantage for ETL. As mentioned above, for multithreading and parallel processing, see Microsoft’s Napa.js project.

    ETL —数据处理管道通常以通用语言(例如Python,Scala或Java)实现。 JavaScript通常不会被关注。但是,这可能是不公平的。 Node的文件系统模块“ fs”提供了一个出色的API,可让您同步或异步调用标准文件系统操作。 Node还可以与MongoDB和许多其他流行的数据库系统配合使用。 Streams API使处理大数据流变得非常容易,这是ETL的另一个潜在优势。 如上所述,有关多线程和并行处理的信息,请参见Microsoft的Napa.js项目

  • Tensorflow.js — Who says JS can’t do cool machine learning stuff? Earlier in 2018, Tensorflow.js was released. This brings machine learning to JavaScript developers — both in the browser and server-side. Tensorflow is a popular machine learning library, developed by Google and made open source in 2015. Gesture recognition, object recognition, music composition… you name it, you can probably have it. The best thing you can do right now is take a look at some demos.

    Tensorflow.js —谁说JS不能做很棒的机器学习材料? 在2018年初, Tensorflow.js发布了 。 这为浏览器和服务器端JavaScript开发人员带来了机器学习。 Tensorflow是一个流行的机器学习库,由Google开发并于2015年开源。手势识别,对象识别,音乐创作……您可以命名,也可以拥有。 您现在可以做的最好的事情就是看一些演示

结论 (Conclusion)

So, should data scientists learn JavaScript?

那么,数据科学家应该学习JavaScript吗?

Learning JavaScript won’t harm your resumé. But don’t learn it as replacement for other languages.

学习JavaScript不会损害您的简历。 但是不要学习它来替代其他语言。

As a first language, the best advice is to learn one of either Python or R. You should also become comfortable using some database language, such as SQL or MongoDB.

作为第一语言,最好的建议是学习Python或R中的一种。您还应该习惯使用某些数据库语言,例如SQL或MongoDB。

However, once you are familiar with the basics, you may want to specialize further. Perhaps you want to learn Apache Spark for working with giant, distributed datasets. Or maybe you’d prefer learn another language such as Scala, or MATLAB or Julia.

但是,一旦您熟悉了基础知识,就可能需要进一步专业化。 也许您想学习Apache Spark以使用庞大的分布式数据集。 或者,您可能希望学习另一种语言,例如Scala,MATLAB或Julia。

Why not consider JavaScript? It will prove valuable if you want to specialize in data visualization, or if your role requires you to work closely with a product built using JavaScript or a related technology.

为什么不考虑使用JavaScript? 如果您想专门研究数据可视化,或者您的职位要求您与使用JavaScript或相关技术构建的产品紧密合作,那么它将证明是有价值的。

JavaScript’s machine learning capabilities are advancing rapidly. For some use cases, it is perhaps already a strong alternative to the usual data science languages.

JavaScript的机器学习功能正在Swift发展。 在某些用例中,它可能已经成为常规数据科学语言的强大替代品。

Ultimately, the decision is both practical and personal. It depends on which aspects of data science you find most interesting, and what career opportunities excite you most.

最终,决定是实际的,也是个人的。 这取决于您发现数据科学的哪些方面最有趣,以及哪些职业机会最使您兴奋。

But with current trends, one thing is for sure. Over the coming years, JavaScript will open more doors than it closes.

但是根据当前的趋势 ,可以肯定的是。 在未来的几年中,JavaScript将为关闭提供更多的机会。

翻译自: https://www.freecodecamp.org/news/should-data-scientists-learn-javascript-e611d45804b8/

 类似资料: