As suggested, encapsulate your prediction model in a web service, then calling it from Rails would be a good way to go.
An other way is to use something like Faktory (https://contribsys.com/faktory/) on top of Redis. You push jobs from Rails and then you pull them from Python to execute. Then Python can enqueue another job with the result which gets consumed by Rails (async callback).
An other way is to use something like Faktory (https://contribsys.com/faktory/) on top of Redis. You push jobs from Rails and then you pull them from Python to execute. Then Python can enqueue another job with the result which gets consumed by Rails (async callback).