https://github.com/michaelgathara/fetch-ml
https://github.com/michaelgathara/fetch-ml
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/michaelgathara/fetch-ml
- Owner: Michaelgathara
- Created: 2023-10-08T02:55:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-17T05:59:16.000Z (over 1 year ago)
- Last Synced: 2025-01-26T05:16:39.408Z (4 months ago)
- Language: Jupyter Notebook
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fetch-ML
This project contains a machine learning model that predicts the number of receipts scanned in a month based on historical data. The model is implemented using PyTorch and is served via a Flask web application.## Table of Contents
1. [Fast Setup](#fast-setup)
2. [Requirements](#requirements)
3. [Installation](#installation)
4. [Training the model](#training-the-model)
5. [Testing the API](#testing-the-api)
6. [Improvements](#improvements)## Fast Setup
You can setup this project quickly using Docker. To do this,
1. Download Docker [here](https://www.docker.com/products/docker-desktop/)
2. Start the Docker Engine after install
3. Build and run the image
```sh
docker build -t predictor .
docker run -p 8000:8000 predictor
```
This will make the flask app accessible at `https://localhost:5000`
Move to the [Testing the API](#testing-the-api) section## Manual Setup
### Requirements
Python, downloadble [here](https://python.org)
Git, downloadble [here](https://git-scm.com/downloads)### Installation
1. Clone the repo
```sh
git clone https://github.com/Michaelgathara/Fetch-ML
cd Fetch-ML
```2. Install the required packages:
I recommend you create an environment prior to this, but it is not required
```bash
python3 -m venv
``````sh
pip install -r requirements.txt
```## Training the model
1. Open `training.ipynb` within the `notebooks/` folder
2. Choose your Juypter Kernel, you should choose the latest Python version you installed above and it will install all the neccesary things for you
3. Run the entire notebook from top to bottomThe training section of the model will output the trained model and a MinMaxScaler to the `app/models/` folder
## Testing the API
You may use CURL to send a request to the app
```sh
cd app/
python3 app.py
- Open a new terminal
curl -X POST -H "Content-Type: application/json" -d '{"month_value": 7500000}' http://localhost:8000/predict
```
You may also call the tester
```sh
cd app/
python3 app.py
- Open a new terminal
python3 tester.py
```## Improvements
This project could honestly have been done using regression rather than an entire neural network