Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Java and Scala? Who uses that in ML? Python has long been the best language for ML, with some competition from Matlab.


Java and Scala? Who uses that in ML? Python has long been the best language for ML

You're kidding, right? Java has been extremely popular for ML for a long time. Not to cast any shade on Python, but I'd say Java and Python are roughly equivalent in this regard. Both have good libraries for various ML tasks and both are very popular in the domain.

For reference, a quick search on mloss.org finds 84 projects identified as "Java" and 105 identified as "Python". So while Python has a small edge in sheer numbers I think that supports my assertion that they roughly equivalent in terms of their popularity for ML.


I feel that much like programming in the corporate world, Python is often used to teach ML while Java is more often used to implement it.


Two out of three most popular deep learning libraries have python front end (theano and caffe). The third one (torch) uses Lua.


There is a large amount of research, including some hedge fund models, that are exclusively using Clojure, on the JVM, for machine learning. Just because public libraries might often be in Python doesn't mean it is the language of choice for the big guys (it often isn't). You'd be surprised how much in-house ML stuff is done on the JVM.


I guess I should have clarified that by ML I really meant DL, as this is the most important area of ML currently. Is there anyone writing large CNNs or RNNs using Java or Scala or Clojure? Are there any widely used DL libraries based on those languages?


There's definitely a popular DL library in Java:

http://deeplearning4j.org/

And at least one seemingly fairly current NN library:

https://github.com/ivan-vasilev/neuralnetworks

An an older "pre deep learning" NN library called Neuroph.

http://neuroph.sourceforge.net/

and another older one called JOONE:

http://sourceforge.net/projects/joone/files/joone-engine/

So in general, the answer is "yes" as to whether or not people are doing Neural Network / DL work in Java. I can't tell you how much such work is happening, or really compare Java/Scala to Python, etc., at that level of granularity though.

And just for a little bit more perspective: IBM Watson is (or was) apparently largely Java based:

http://www.drdobbs.com/jvm/ibms-watson-written-mostly-in-jav...


Ok, I see. Though I'm not sure why anyone who wants to write DL code today would go with anything other than Python on top of CUDA, or just using one of three main DL libraries (Caffe, Torch, Theano).


This is just a strange thing to say. There are so many languages out there with very interesting features, I'm not sure why you insist python is the only obvious choice. In my experience, all of the advanced research for proprietary companies in this area is not being done on Python, at least not those who are willing to speak at conferences. There's a lot of GPU computing also available to Java, if you think that's the reason Python is the only option. Python is certainly more widely used as a teaching language, so I guess you might see more libraries that are widely known because of universities in the academic environment, but I'm not sure why you think that means that it's the only language that major institutions are using? Because the reality is that almost all the cutting edge stuff that I've read about is not being done in python at all.


Can you give an example where a cutting edge research is done using something other than Python or MatLab? The only exception is Facebook using Torch. In fact, Python dominance in DL is not just my opinion. Even Java devs admit it while trying to justify using Java for DL [1]: "We’re often asked why we chose to implement an open-source deep-learning project in Java, when so much of the deep-learning community is focused on Python." [1] http://deeplearning4j.org/compare-dl4j-torch7-pylearn.html


Sure, how about Prismatic, a big San Fran ML shop catering to several industries. They are nearly 100% Clojure.


From looking at their website Prismatic appears to be a start up building APIs to access ML tools and providing services for enterprise customers. I looked at their job postings and they don't seem to be very research oriented. What makes you think they are doing cutting edge research in DL?


No one can say for sure what Prismatic is doing behind the scenes since it is a commercial entity but I've seen them speak at a couple conferences, which led me to believe they are doing some pretty novel ML studies. I could be wrong. But, your initial point was to suggest that a company shouldn't use anything other than Python when starting new ML projects, and Prismatic is an example of a company doing just that: using Clojure in this case. The article you mentioned earlier gives some good reasons why Python is often not the best choice for ML: speed, security, portability are often the reasons for leveraging the JVM (where Clojure lives). This is not a knock against Python, just pointing out that there is major stuff happening in ML that has nothing to do with Python. NYU's machine learning lab prefers C++ over other languages, and major projects like Siri and Watson rely a lot on C++ and Prolog. The point is that it makes no sense to claim that Python is the only language anyone should consider for these tasks.


That's a highly opinionated statement; lots of languages are used for machine learning, Python certainly has no monopoly on the field. There are significant entities using Clojure, Lua and other languages to do interesting things in this arena.


It seems like a no-brainer that one of the largest programming languages in the world should have strong machine learning tools. Maybe the reason ML isn't done in Java and Scala is simply because the tools haven't been there. Python's great, but if you want to do ML/DL with distributed systems working with Hadoop and Spark, it makes more sense to do that in Java and Scala.


Python isn't used for much ML in the field from my experience. It is heavily used for teaching and learning about ML - but for actual production ML, I've seen mostly compiled languages. The main reason is that ML is highly parallelizable and Python isn't terribly good at that. Plus you need to crunch large datasets and speed becomes important.

So, respectfully, lots of people use languages other than Python for ML, and I doubt if Python is even the largest deploy base of ML.


I've seen Python (and R) used all the time for exploratory ML. Do all of your feature extraction, feature selection, parameter tweaking, and backtesting in Python, and then once you have a model that works reasonably well, port the feature extraction for only the features that actually work well over to a compiled language like Java or C++, train your models on lots of data, and do your actual classification in the compiled language.

Most ML is an iterative process, and the final model that's used in production is just the tip of the iceberg of the development work that went on. Python works as well for exploratory programming there as it does for any other domain.


In research, Python is extremely popular since all the number crunching is done with numpy or Theano, which use BLAS and CUDA.


I've seen Python used heavily in ML where much of the work is done on the GPU anyways. There are plenty of libraries for that, and Python's slow nature isn't as relevant (though it still becomes relevant when CPU processing is the bottleneck!).


I work with a team that is doing large scale ML and CV on millions of pages and videos. It's a production system tied to millions of dollars in revenue. Everything's done in Python.


The cool thing is that you can use many languages to do ML! Once you know the concepts, they can be implemented in dynamically-typed languages like Python, R, or JavaScript, or statically-typed languages like Scala, Java or C++. Functional or imperative, there are many ways to skin the ML cat. We're lucky to have such a diverse set of tools!


People who do ML for a job?

There's plenty of heavy duty machine learning libraries and implementations for big data platforms. Just spark alone has a fairly high quality one:

http://spark.apache.org/docs/latest/mllib-guide.html


Spark, and its machine-learning module MLlib, are Java/Scala, although it has a Python API.


[deleted]


>Quick job search shows that there are many companies out there that do ML in Scala, e.g. Sharethrough, Teralytics, LeadIQ.

What do you use to do a search that specific?


Sounds like he used LinkedIn to me.


I favor Python as well, but from what I see in industry, Python is best for exploration/initial experiments and Java (and recently, Scala) is for production.


Scala is actually getting quite popular for machine learning, as it translates well to parallelization.


Our data scientists are learning Scala and Spark (MLLib) as a replacement for Python and R. So sure, maybe Python has long been the "best language for ML" but also one time in the not so far past "MySpace was the best social network"


What kind of tasks your data scientists are working on?


Mostly anomaly detection.


Interesting. What are the reason for this transition from Python and R to Scala and Spark?


Java and Scala are the main languages of Spark, one of the most popular large scale machine learning tools out there.


What do you recommend is a good primer (something similar to the article OP posted) for Python folks?


I feel like I've read literally this exact subthread on HN twice before. Am I going insane?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: