Rails and Machine Learning implementation of Python or Ruby

568 views
Skip to first unread message

Adrián Rama Aguilar

unread,
Aug 16, 2019, 4:34:16 PM8/16/19
to Ruby on Rails: Talk
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.

Walter Lee Davis

unread,
Aug 16, 2019, 5:30:33 PM8/16/19
to rubyonra...@googlegroups.com
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

> On Aug 16, 2019, at 11:53 AM, Adrián Rama Aguilar <adrianra...@gmail.com> wrote:
>
> 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.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8a685786-e433-4fe4-b635-2387a7b3a15d%40googlegroups.com.

Jake Niemiec

unread,
Aug 16, 2019, 5:35:37 PM8/16/19
to rubyonra...@googlegroups.com
> 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)


On Fri, Aug 16, 2019 at 3:34 PM Adrián Rama Aguilar <adrianra...@gmail.com> wrote:
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.

--
Message has been deleted

Walter Lee Davis

unread,
Aug 17, 2019, 9:40:21 AM8/17/19
to rubyonra...@googlegroups.com
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

> On Aug 16, 2019, at 10:26 PM, Adrián Rama Aguilar <adrianra...@gmail.com> wrote:
>
> And it will be possible to use scientific libraries.??
> El viernes, 16 de agosto de 2019, 16:34:16 (UTC-4), Adrián Rama Aguilar escribió:
> 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.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e42afea2-b206-46b3-ad80-a6adb2744bdf%40googlegroups.com.

Colin Law

unread,
Aug 17, 2019, 10:36:30 AM8/17/19
to Ruby on Rails: Talk
On Sat, 17 Aug 2019 at 14:40, Walter Lee Davis <wa...@wdstudio.com> wrote:
>
> 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.

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

Colin

Joe Guerra

unread,
Aug 19, 2019, 2:57:57 PM8/19/19
to Ruby on Rails: Talk
Here's a good article on some basic machine learning with Ruby.


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

Adrián Rama Aguilar

unread,
Aug 19, 2019, 3:20:36 PM8/19/19
to rubyonra...@googlegroups.com
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.

--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/hiDYEAEMzOc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/88d9f2d5-b584-4b99-9b87-7d19be149fb2%40googlegroups.com.

Joe Guerra

unread,
Aug 19, 2019, 3:24:44 PM8/19/19
to Ruby on Rails: Talk
Reply all
Reply to author
Forward
0 new messages