Exploring Uber Ludwig for code-less machine learning
Published: 2019-10-17 22:31:23

# Introduction
## Goal:
This past summer was one of my first deep dives in terms of time commitment into using deep learning on actual data outside of a tutorial. More specifically, I used Recurrent Neural Networks to do a form of sentiment analysis on a comment dataset.([[https://www.kaggle.com/c/jigsaw-unintended-bias-in-toxicity-classification/overview][Ref]]) So, I was able to train, evaluate, and productionize a model; but I would like to get a better idea of the tradeoffs between dollars spent, developer time, and accuracy when considering using different tools to accomplish the same purpose. First, I will start by looking into "AutoML tools".
<br>
AutoML tools are a way to train a machine learning model without needing to know much about machine learning. They often don't require you to do any coding, which allows a wider audience to take advantage of machine learning, but also possibly allows programmers to implement machine learning models more quickly. There may be some downside to tools like this existing, such as the expected influx of poorly created models, but I will try to save my opinions for another blog post.
<br>
What would be useful, is if programmers knew more about these AutoML tools that way they could decide how to make best use of them, but also be aware of any potential pitfalls they have.
<br>
There are many tools that go by the name of AutoML. In my experience (YMMV), the AutoML tool offered by Google Cloud seems to be the most well known. I wouldn't be surprised though if Amazon's corresponding AutoML tool offered through AWS is the most well known AutoML in some circles. I have heard that Google's AutoML uses Neural Architecture Search to build the best model it can for the data you give it. But according to [[https://towardsdatascience.com/autokeras-the-killer-of-googles-automl-9e84c552a319][this medium article]] "to use Google’s AutoML for computer vision, it will cost you USD $20 per hour". In an enterprise setting that may be doable but just for experimentation and use as a personal side project, I would prefer something much cheaper.
<br>
So, that is where Uber's Ludwig comes in. What is amazing about Ludwig is that you only need a CSV file containing your data, a list of columns to use as inputs, and a list of columns to use as outputs.([[https://uber.github.io/ludwig/getting_started/][Ref]])
# Ludwig
## Download & Installation
For instructions on how to download and install ludwig, see here: https://uber.github.io/ludwig/getting_started/ and https://uber.github.io/ludwig/examples/. (On the examples page, I only read and followed the first example.) I will not copy these docs in this post but instead just add some commentary.
### IMPORTANT: Numpy Error
When I followed the official docs I ran into an error when running ```pip install ludwig```
It would not fully install because their were some packages that were already installed but at the wrong version that couldn't be dealt with. They way I was able to fix this was the following: 
<br>
Uninstall all versions of numpy. It found a version in anaconda, and I just temporarily moved all 'numpy*' files and folders out of the site-packages folder in the anaconda folder so ludwig would no longer find them and it would install its own version of numpy.
# Results
After fixing the numpy issue, the following bash command ran correctly with no errors: ```ludwig experiment --data_csv text_classification.csv --model_definition_file model_definition.yaml```
Again, follow the 2 links I provided to the official docs to know what this command does. In brief, what this command does is run training and validation when you give it your data (text_classification.csv) and some specifications for your model (model_definition.yaml). This command through 10 epochs and finished in just under 627 seconds. I ran this on a laptop with 1 GTX 1060. The final accuracy was 0.9343, which I would say is pretty impressive for not having needed to do any coding.
# Follow-up
I am also interested in looking into very high level programming libraries such as keras, fast.ai, pytorch-lightning and others, so hopefully I will get around to throwing them in this comparison.