GithubHelp home page GithubHelp logo

career_accelerator_p6-ml_api's Introduction

Machine Learning API using FastAPI

Develop a Machine Learning API (Application Programming Interface) using FastAPI.

python MIT licensed Python

Introduction

This is the last project of the program, congratulations for all the work done until now.

In this project, we aim to help you to discover how to create an API that might be requested to interact with a ML model. This is an interesting solution when you want to keep your model architecture secret or to make your model available to users already having an API. By creating an API, and deploying it, your model can so that receive request using the internet protocol as presented by the illustration below.

API illustration

Source : The benefits of Machine Learning APIs - UbiOps

Description

You will have a minimal API demo with FastAPI, this will just serve you to make sure that everything works correctly. Then, you will have to make your own API, this allowing you to interact with a Machine Learning model, that is to say:

  • Pass data through a request;
  • Get the data in using the API;
  • Apply the necessary processing;
  • Submit the processed data to the ML model to make the predictions;
  • Process the predictions obtained and return them as the API's response ot the input request.

Instructions

Your task is to build an API integrating a ML model using FastAPI. Clone this repository to use it as a template, do not forget to change the readme at the end of the project. Your work should follow these next steps.

  1. Build a ML model to predict the Sepsis, during the 2 first weeks.

  2. Build an API using Fast API, during the remaining weeks, to embed the Titanic classification model built.

Upon completion of your project, you are required to write a blog post on your thought process on medium, LinkedIn, personal blog, or any other suitable blogging site.

Rubrics

Machine Learning :

  • Excellent: Have a pipeline/function that takes inputs and make accurate predictions.

  • Good: Have a pipeline/function that takes inputs and make predictions.

  • Fair: Have a pipeline/function that takes inputs but faces bugs while doing predictions.

API :

  • Excellent: Have an API that works correctly, taking inputs multiple inputs and returning all the related predictions.

  • Good: Have an API that launches, makes predictions and returns results.

  • Fair: Have an API that launches but having bugs regarding inputs handling or returning predictions.

Setup

Install the required packages to be able to run the evaluation locally.

You need to have Python 3 on your system (a Python version lower than 3.10). Then you can clone this repo and being at the repo's root :: repository_name> ... follow the steps below:

  • Windows:

      python -m venv venv; venv\Scripts\activate; python -m pip install -q --upgrade pip; python -m pip install -qr requirements.txt  
    
  • Linux & MacOs:

      python3 -m venv venv; source venv/bin/activate; python -m pip install -q --upgrade pip; python -m pip install -qr requirements.txt  
    

The both long command-lines have a same structure, they pipe multiple commands using the symbol ; but you may manually execute them one after another.

  1. Create the Python's virtual environment that isolates the required libraries of the project to avoid conflicts;
  2. Activate the Python's virtual environment so that the Python kernel & libraries will be those of the isolated environment;
  3. Upgrade Pip, the installed libraries/packages manager to have the up-to-date version that will work correctly;
  4. Install the required libraries/packages listed in the requirements.txt file so that it will be allow to import them into the python's scripts and notebooks without any issue.

NB: For MacOs users, please install Xcode if you have an issue.

Run FastAPI

  • Run the demo apps (being at the repository root):

    FastAPI:

    • Demo

      uvicorn src.demo_01.api:app --reload 
      

Resources

Here are some ressources you would read to have a good understanding of FastAPI :

Contributing

Feel free to make a PR or report an issue ๐Ÿ˜ƒ.

Oh, one more thing, please do not forget to put a description when you make your PR ๐Ÿ™‚.

Author

career_accelerator_p6-ml_api's People

Contributors

eaedk avatar eaedkazubi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.