Rails and Machine Learning implementation of Python or Ruby

Hi everyone.!!

I’m working in a ROR app, which manages banks and I’d like to implement machine learning for predictions such as ip connections, number of transactions or number of sing in users by institucion in the app, so I’ve been reading about linear regresion, but most of the info or how to do it is with pyhton, so here comes my doubts to know if python modules can be implemented or how to do this implementation in machine learnig in Ruby at a ROR app. Thank you and I look forward to your contributions.

Ruby will happily co-exist with python, if you want to "shell out" to that language, you can read the response back in and continue in Ruby. There are at least three ways to do this, from the humble back-tick ` operator to Open3 or the system call. And, hang on, there's Terrapin https://github.com/thoughtbot/terrapin to make this even safer.

Walter

implement machine learning for predictions such as ip connections, number of transactions or number of sing in users by institucion in the app

Do you want to predict user growth over time? You may get further with predictive modelling rather than machine learning. (and with less pain)

Best of both worlds: https://ankane.org/rails-meet-data-science

If you shell out to Python, you will have access to anything that Python has access to. I haven't used it in many years, so I don't know what that might be, but it would be the same as running your Python application raw in the native operating system, because that's what you're actually doing.

python your_program.py

vs

#! /usr/bin/env ruby

result = system 'python your_program.py'

There's really no difference from the point of view of the python program.

Walter

Except that the environment (PATH USER etc) may well be different of course).

Colin

Here’s a good article on some basic machine learning with Ruby.

https://medium.com/@ryanflach/basic-machine-learning-in-ruby-9cce4a67b40b

don’t know what you want to accomplish, but this is worth a read.

Thank you, interesting article. My goal is to implement a module in my Rails application that has machine learning, taking into account that this is for purposes in addition to learning and experience, and the way I would like to use it is as a module of forecasts of certain characteristics such as They are those described in the publication. And of course being a total beginner in this good subject, I am interested in knowing how it can be implemented, what algorithms to use, if a neural network is necessary, if only using the algorithms such as linear regression is useful (or other associated ML algorithms), such as implementing them if only with Ruby is enough or if I can use Ruby in conjunction with Python.

here’s a huge list…

https://github.com/arbox/machine-learning-with-ruby