by y14 · 10y ago · 0 comments
But, as encouraging as it is, if your’e thinking about developing a real, production-ready, data science project in ruby - don’t. At least not yet. The libraries around machine learning, neural networks etc are old, unmaintained and usually don’t even work.
My approach thus far has been to write a simple wrapper script around the library (in it's native language) and then do a standard output of the result set in JSON.
Then within Ruby, I just do a `shell`, capture the result and do a JSON parse on the response. It's crude, but works reliably well, I don't have to worry about any bridge libraries supporting the latest language version.
Why is this? Are there inherent limitations in the language that has Ruby taking a backseat to Python in ML and maths/statistical applications? Or is it just due to neglect by the community?
(I started leaning ruby about ten months ago and have only just started to gain some proficiency, so I do not know much about the workings of the ecosystem - or the innards of ruby for that matter)
So perhaps less about neglect from the Ruby community, and more proactive-ness from the Python one.
We probably can expect to see implementations in all languages at some point. Floating point errors are not even that a big deal since we're dealing with statistics anyway.
That being said, neural networks are very resource/computation heavy. I wrote one in golang and cut my execution time in half just by encoding my matrices as flat arrays instead of two dimensional arrays. If ruby is to be used to build neural networks, it will need to perform the big work in a binary binding, like tensorflow does with its C++ layer.