
Flask API for training and predicting using scikit learn models
The Flask API for scikit-learn is a straightforward application designed to serve machine learning predictions through a web interface. By integrating Flask with scikit-learn, this tool allows users to harness the power of predictive models easily. It loads a pre-trained scikit-learn model into memory at startup and offers two primary endpoints for interaction: one for predicting outcomes and another for training the model, making it accessible even for those who may not be deeply familiar with machine learning.
This application stands out for its ease of use and flexibility, supporting any scikit-learn model for predictions. Whether you’re a data scientist looking to deploy a model or a developer wanting to integrate predictions into an application, the Flask API serves as an efficient solution.
Predict Endpoint: Accepts a JSON object with independent variables and returns an array of predictions through a POST request.
Train Endpoint: A dedicated GET endpoint for training or retraining the model, currently set up for a random forest model based on the Titanic dataset.
Model Wipe Functionality: Easily remove the trained model from memory using the /wipe endpoint, ensuring a clean slate.
Flexibility with Models: The API allows for the use of any scikit-learn model, providing versatility in usage scenarios.
Dependencies Management: Built on popular libraries like Flask, scikit-learn, pandas, and numpy, ensuring robust performance and compatibility.
User-Friendly JSON Interface: Simplifies the process of sending and receiving data, making it accessible for developers and data analysts alike.
This Flask API for scikit-learn embodies a practical tool for anyone looking to implement machine learning predictions seamlessly into their applications.

Flask is a lightweight and popular web framework for Python, known for its simplicity and flexibility. It is widely used to build web applications, providing a minimalistic approach to web development with features like routing, templates, and support for extensions.