Querying a model in an API using Python

Challenge

In this project, we had a logistic regression model, and we needed to create an application where users would input only a csv file with explanatory variables, and the application would return another csv with the score column (response variable) added.

Deliverable

To achieve this, we used the Pickle library and the Flask micro-framework in Python. We saved the model to a pkl file using Pickle. Then, using Flask, we created an interface with instructions where the user uploads the file, and the application calculates the score, saving a new csv with the original data and adding the column with the score.

The application looks like this for the end user to use. Just choose the file and submit. If you want to see how the code looks, you can access my GitHub and check out an example.

Ana Andrade