Live data from Hacker News

JavaScript for Data Science

js4ds.org

41–50 of 83 posts

Re: JavaScript for Data Science

#41
post #36
post #32

I am a noob to Javascript, so if someone knows better, than please correct me about this, but arrow functions aren't meant to replace normal function syntax, right? From [1], it seems like the main point of arrow syntax is to allow you to inherit the "this" parameter if you are inside a method. Meanwhile, you need normal function syntax if you are creating a constructor, making a method function for a prototype, or m…

I've seen a majority of sources abandon the function keyword entirely in favor of const arrow declarations (and shorthand method syntax). FWIW I personally like the function keyword, since it's clear what it is to non-JS readers, but primarily because it hoists to the top of its file, so unimportant utility functions can sit unobtrusively at the end of the file, thereby letting readers encounter more important logic…

Interesting to know that what the article recommends is indeed the industry standard. I'd forgotten about hoisting until you brought it up!

Re: JavaScript for Data Science

#42
To address some of the skepticism about when and where javascript would be appropriate in data science, would you want to fit a logistic regression model in javascript? Probably not, but to build a solver that takes model outputs and visualizes the changes in predicted probabilities based on different combinations of variables? This is definitely where javascript would make sense. Visualization, dashboards, reporting, and exploratory analysis are all ripe domains for developing rich responsive UIs. Basically, any layer where you have a data-to-human interface can be leveraged with javascript.

There is a lot of great work happening in this space already. In the R world for example, shiny makes heavy use of js to the point that you often can't tell where R code ends and javascript begins. Plotly's Dash provides bindings for R, Python, and Julia. Personally, as a data scientist, I have been excitedly learning React because it really rips the landscape wide open for all the use cases I mentioned above. It then makes sense to have libraries that give JS users a good data model and can do most of the same numerical computation that we'd be doing in other languages. Again, you probabaly don't want to do serious numerical work in js, but remember people said that about Python ten years ago too.

I love the framing of this book, because I want more data scientists to start thinking about the presentation of data and spark some bits of ingenuity to make datasets and model outputs accessible to non-data scientists. Data scientists should be the ones writing the tools that interface data with humans because of their domain knowledge. But this is a different skillset and usually the work of SW engineers. Of course engineers can also have great data intuition too, but I really do encourage data scientists to develop their front end skills, it's well worth it.

Re: JavaScript for Data Science

#43

I know that data science is a broad and somewhat vague term but this - We will cover: Core features of modern JavaScript Programming with callbacks and promises Creating objects and classes Writing HTML and CSS Creating interactive pages with React Building data services Testing Data visualization Combining everything to create a three-tier web application - this isn't data science.

nobody ever writes books assuming you know how to use the language, I suppose it decreases customer base.

While understanble, I hate this. "Here's 100 pages of python before we get to the good stuff", which ends up not even being good.

Publishers should just offer a free e-book of said language, and make it a requirement.

Re: JavaScript for Data Science

#44

Earlier quoted context omitted.

nobody ever writes books assuming you know how to use the language, I suppose it decreases customer base.

While understanble, I hate this. "Here's 100 pages of python before we get to the good stuff", which ends up not even being good. Publishers should just offer a free e-book of said language, and make it a requirement.

[deleted]

Re: JavaScript for Data Science

#45
I don't see the point of this. You already have a ubiquitous, easy-to-learn, high-level language that's great for data science, it's called python. If you're a JavaScript developer who wants to get into data science but are too lazy to learn python, you probably weren't that interested in data science in the first place.

Python definitely has some problems, but if you were going to have a new lingua franca for data science, it would probably be something like Julia, certainly not JavaScript.

Re: JavaScript for Data Science

#46

I know that data science is a broad and somewhat vague term but this - We will cover: Core features of modern JavaScript Programming with callbacks and promises Creating objects and classes Writing HTML and CSS Creating interactive pages with React Building data services Testing Data visualization Combining everything to create a three-tier web application - this isn't data science.

Well the problem with “data science” is that it costs a shit ton of money but rarely integrates into anything. A book about wiring data science models into real user facing application maybe isn’t data science, but sure is useful...

Re: JavaScript for Data Science

#47

I know that data science is a broad and somewhat vague term but this - We will cover: Core features of modern JavaScript Programming with callbacks and promises Creating objects and classes Writing HTML and CSS Creating interactive pages with React Building data services Testing Data visualization Combining everything to create a three-tier web application - this isn't data science.

It's more like Presenting and Serving Models using Javascript for Data Science.

Re: JavaScript for Data Science

#48

I don’t want to repeat the old and tired JavaScript hate, but this just isn’t a great idea. I’d suggest that there are 3 important primitives for data science: flexible numeric types, fast math/algorithm libraries, and data manipulation being easy. JavaScript doesn’t really have any of these. Numbers are 64bit floats only - no integers, no big numbers. There aren’t equivalents to Numpy/Pandas/Scikit Learn, and the la…

On point 3 - I had to implement a logistic regression model in js recently and implementing all of the required math methods (eg dot product, transpose, vectorized addition, etc.) were actually super easy with js’s functional array utilities.

Re: JavaScript for Data Science

#49
post #36
post #32

I am a noob to Javascript, so if someone knows better, than please correct me about this, but arrow functions aren't meant to replace normal function syntax, right? From [1], it seems like the main point of arrow syntax is to allow you to inherit the "this" parameter if you are inside a method. Meanwhile, you need normal function syntax if you are creating a constructor, making a method function for a prototype, or m…

I've seen a majority of sources abandon the function keyword entirely in favor of const arrow declarations (and shorthand method syntax). FWIW I personally like the function keyword, since it's clear what it is to non-JS readers, but primarily because it hoists to the top of its file, so unimportant utility functions can sit unobtrusively at the end of the file, thereby letting readers encounter more important logic…

[deleted]
Post reply on HN