alexandresjunior / machine-learning-flask-api

Basic example of serving Machine Learning models with APIs in Flask

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Machine Learning Flask API

This repository contains a Machine Learning API developed whose purpose is to demonstrate the construction of an API using the Flask microframework in Python and cover concepts related to the development of Machine Learning models.

Project Organization

├── LICENSE
├── Makefile           <- Makefile with commands like `make data` or `make train`
├── README.md          <- The top-level README for developers using this project.
├── data
│   ├── external       <- Data from third party sources.
│   ├── interim        <- Intermediate data that has been transformed.
│   ├── processed      <- The final, canonical data sets for modeling.
│   └── raw            <- The original, immutable data dump.
│
├── docs               <- A default Sphinx project; see sphinx-doc.org for details
│
├── models             <- Trained and serialized models, model predictions, or model summaries
│
├── notebooks          <- Jupyter notebooks. Naming convention is a number (for ordering),
│                         the creator's initials, and a short `-` delimited description, e.g.
│                         `1.0-jqp-initial-data-exploration`.
│
├── references         <- Data dictionaries, manuals, and all other explanatory materials.
│
├── reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
│   └── figures        <- Generated graphics and figures to be used in reporting
│
├── requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
│                         generated with `pip freeze > requirements.txt`
│
├── setup.py           <- makes project pip installable (pip install -e .) so src can be imported
├── src                <- Source code for use in this project.
│   ├── __init__.py    <- Makes src a Python module
│   │
│   ├── data           <- Scripts to download or generate data
│   │   └── make_dataset.py
│   │
│   ├── features       <- Scripts to turn raw data into features for modeling
│   │   └── build_features.py
│   │
│   ├── models         <- Scripts to train models and then use trained models to make
│   │   │                 predictions
│   │   ├── predict_model.py
│   │   └── train_model.py
│   │
│   └── visualization  <- Scripts to create exploratory and results oriented visualizations
│       └── visualize.py
│
└── tox.ini            <- tox file with settings for running tox; see tox.readthedocs.io

Overview

In this repository, you will find an implementation of a Machine Learning API that covers the following topics:

  • Building a basic API with a single endpoint using the Flask microframework.
  • Testing the API in different scenarios, including browser-based testing and tools like Postman.
  • Consuming external and internal APIs using Postman and the Requests library in Python.
  • Integrating pre-trained models and user-developed models.
  • Utilizing serialization to ensure consistency of the models used in the API.
  • Implementing basic authentication to protect API access.
  • Deploying the application in various environments, including cloud servers.
  • Managing dependencies using virtualenv and requirements.

Development Environment

To run this project, you need to have the following development environment set up:

  • Python 3.x: It is recommended to use the latest version of Python 3.
  • Flask: The Flask microframework is used to build the API. You can install it using the pip package manager: pip install flask.
  • Additional dependencies: If the API uses other specific libraries, they will be mentioned in the requirements.txt file in the repository.

Make sure to set up a virtual environment for the project to avoid conflicts with other Python dependencies. You can create a virtual environment using the built-in venv tool in Python or use other popular tools like conda.

Deepening

This repository provides an overview of Machine Learning API development. If you want to delve deeper into related topics, we recommend exploring other available resources, such as courses and documentation specifically focused on web development, Flask, HTTP verbs, API architectures, authentication, and more.

Contribution

This repository was created to serve as an example and foundation for the development of Machine Learning APIs. If you have any suggestions, improvements, or fixes, feel free to contribute. Simply fork this repository, make the desired modifications, and submit a pull request.

Support

If you have any questions or need support, please open an issue in this repository. We will do our best to assist you and provide the necessary guidance.


Project based on the cookiecutter data science project template. #cookiecutterdatascience

About

Basic example of serving Machine Learning models with APIs in Flask

License:Other


Languages

Language:Jupyter Notebook 71.9%Language:Makefile 14.3%Language:Python 12.1%Language:Dockerfile 1.8%