Why are most machine learning models (not frameworks) written in Python? Even through almost any programming language can be used for machine learning?
My impression from what code I’ve looked at is that little computation is done by the Python code itself, so there’s little by way of gains to be had by trying to use something higher-performance, which eliminates a lot of the reason one would use some other languages.
Python’s cross-platform, albeit with a Unix heritage, so it doesn’t create barriers there.
It’s got an ecosystem for distributing libraries over the network, and there’s a lot of new code going out and being distributed rapidly.
Python isn’t statically-typed. Static typing can help write more-robust code. If you’re writing, say, the next big webserver, I’d want to have that checking. But for code that may often be running internally in a research project — and this is an area with a lot of people doing research, a failure just isn’t that big a deal. So, again, some of the reasons that one might use another language aren’t there.
And I imagine that there’s also inertia. Easier to default to use what others would use.
If you have another language in mind, you might mention that, see if there might be more-specific things.
GammaGames@beehaw.org 3 days ago
It’s a popular language for data scientists
Overspark@piefed.social 3 days ago
Yeah this. Python was already popular with the early adopters, and it’s a fairly easy language to learn and use. After that it became a network effect thing: all the best tools were already written in Python so people continued to do so.
TehPers@beehaw.org 3 days ago
Also a lot of data scientists aren’t really programmers. They just learned Python to do data science. Learning a new language for this purpose would be both very difficult and, in their eyes, often unnecessary.