Rails: How to use ActionMailer by itself?

I'm making a website that will heavily make use of machine learning and data mining algorithms. Should I use Django or Rails?

  • It seems to me that Python is a better supported language for machine  learning, but Rails is better for rapid web development. Insights from  the business / hiring side of things would also be helpful.

  • Answer:

    Here's a thought: write the ML part and the web interface separately, and have them communicate by a simple internal API. Then you can write each part separately, in whatever language. For instance, you might decide that it made sense to write the numerically intensive parts in R, but writing a web frontend in R would be the act of a crazy person.

Phil Darnowsky at Quora Visit the source

Was this solution helpful to you?

Other answers

Python is a great language with very good Machine Learning and Data Mining libraries (http://scikit-learn.org/stable/, http://www.nltk.org/). That, I think, is key to decide between Django or Rails (Python vs Ruby). You can always go for a layered architecture and use different platforms for each problem. The Machine Learning and Data Mining part could be done using Python and Django and passing data through an API (using http://www.django-rest-framework.org/ or https://django-tastypie.readthedocs.org/en/latest/ - recommended with this extension we built https://github.com/tryolabs/django-tastypie-extendedmodelresource -). That way, the data intensive part of the application is more independent and you can use RoR or AngularJS to complement. Of course, many things depend on the type of application, so no guarantees! ;-)

Ernesto Rodríguez

I started at my current company with a pre-existing RoR application, and my job was to build ML-based components to replace/augment a lot of work which was being done manually.  I found the library situation for Ruby to be very poor.  There are some ML libraries, but they're not nearly as well maintained and well designed as those available for Python.  I would suggest either using JRuby, and depending on Java's excellent suite of ML libraries, or better still just sticking with Python.  I ended up building a Python webservice that the Rails app talks to, but I wouldn't consider it a good solution for various reasons. Building a web application, you'll have to work with: the webserver language (ruby or python), javascript, HTML, CSS and SQL.  That's a minimum of five* different languages/syntaxes** you have to keep straight.  Add another language for the analytics, and you end up duplicating a lot of functionality between the analytics code to access, process and display data.  Adding complexity and context switching will not get your product built, but it will annoy you, slow you down and complicate deployments.  Python will work essentially out of the box with Django and scikits.learn for most applications.  Rails probably is a superior web framework to Django in many ways, but those advantages will be outweighed by the costs of supporting an extra codebase. * Also BASH, and various configuration file formats, but not very frequently. ** Yes, HTML, CSS and SQL are not full programming languages per se, but keeping them straight does add cognitive load.

Lucas Wiman

Ultimately, both Ruby and Python will do the job, and you will probably not be missing out on much if you choose one vs the other in terms of web development.  In terms of machine learning, Ruby does not have nearly as many libraries available as Python. If you choose to use Ruby, you can use rails and try RinRuby to integrate R and Ruby [1].  RinRuby creates a new persistent R session and can be used to evaluate expressions and get results as your Ruby code executes. This will allow you to leverage the machine learning libraries of R and the web development ease of Rails. RinRuby is a relatively flexible solution, I have found.  I only deployed it in a very simple web application, so I am not sure how it will scale, unfortunately.  I wrote up a short brief on rinruby at [2]. Another option is to use Ruby and call Rscript or R CMD BATCH to run a batch script with input from STDIN and grab output from a file or STDOUT. References: 1.  https://sites.google.com/a/ddahl.org/rinruby-users/ 2.  http://viksalgorithms.blogspot.com/2012/01/using-r-in-ruby.html

Vik Paruchuri

Python has better ML libs. And the difference between Django and RoR isn't so great that it's worth adopting a second language for. Hiring-wise, the languages are too similar. You'll be able to find both Python and Ruby programmers. But neither is the sort of language that, in 2014 (as opposed to 2004) signals the "taste" of a good programmer.

Phil Jones

Regarding the web framework part; there are other python based web frameworks than django. If you can do without i18n, built-in caching and other django-thingies, there's flask which is a thin web framework similar to ruby's Sinatra. I've used to it to great success in some projects.

Jens Tinfors

Python is well supported language but probably the biggest number of processes about machine learning and data meaning will work in background. Finnaly, it doesn't metter what language you will use to create your website because will operate on final, computed data. The most important is the background language and on my experience i would like to recommend python for you.

Roman Piekarski

Use RoR or Django for web part and do ML is the lang you like python or R and communication can be done using zeromq or subprocess etc . . .

Kr Ace Kumar Ramaraju

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.