https://github.com/perkzen/mbajk-ml-web-service
Web application for predicting the number of available bike stands at one of the MBajk bike stations.
https://github.com/perkzen/mbajk-ml-web-service
fastapi machine-learning nextjs recurrent-neural-networks
Last synced: about 2 months ago
JSON representation
Web application for predicting the number of available bike stands at one of the MBajk bike stations.
- Host: GitHub
- URL: https://github.com/perkzen/mbajk-ml-web-service
- Owner: perkzen
- Created: 2024-03-07T15:38:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T19:47:50.000Z (about 2 years ago)
- Last Synced: 2024-05-22T19:49:17.962Z (about 2 years ago)
- Topics: fastapi, machine-learning, nextjs, recurrent-neural-networks
- Language: Jupyter Notebook
- Homepage: https://mbajk-ai.up.railway.app/
- Size: 798 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bike Station Availability Prediction Service
## Description
Web application for predicting the number of available bike stands at one of the MBajk bike stations. The prediction service is based on a recurrent neural network model (GRU). Its components are a FastAPI REST API and Next.js frontend.
This project implements machine learning pipelines for continuous data fetching and model training to ensure that the prediction models are constantly improving over time.
It utilizes ONNX (Open Neural Network Exchange) Runtime for fast prediction performance and model quantization techniques to reduce model size without significantly impacting accuracy.
## Project structure
```
├── README.md <- File containing project description and setup instructions
├── data
├── processed <- Processed data, prepared for training
└── raw <- Raw downloaded data
├── models <- Trained and serialized models, model predictions, or summaries of models
├── notebooks <- Jupyter notebooks
├── reports <- Generated analysis files
└── figures <- Generated graphs and images used in the analysis
├── pyproject.toml <- File defining dependencies, library versions, etc.
├── src <- Source code of the project
├── __init__.py <- Initializes the "src" directory as a Python module
├── data <- Scripts for data downloading, processing, etc.
├── models <- Scripts for training predictive models and using models for prediction
├── serve <- Scripts for serving models as web services
├── client <- Source code for the user interface
├── validation <- Scripts for data validation
|── tests <- Tests for the project
|── utils <- Utility functions
└── visualization <- Scripts for visualization
```
## ML Service environment variables example
```env
WINDOW_SIZE=48
TOP_FEATURES=4
LAT=46.5547
LON=15.6466
MBAJK_API_KEY=
MLFLOW_TRACKING_URI=
MLFLOW_TRACKING_USERNAME=
MLFLOW_TRACKING_PASSWORD=
DAGSHUB_USER_TOKEN=
TF_USE_LEGACY_KERAS=1
```
## ML Client environment variables example
```env
NEXT_PUBLIC_API_URL=
NEXT_PUBLIC_GOOGLE_MAPS_KEY=
```
## Scripts
Python scripts that can be run are defined in the `pyproject.toml` file.
### Script usage
To run a script, use the following command:
```bash
poetry run poe
```
## Makefile
The `Makefile` contains the most commonly used commands for the project. To run a command, use the following command:
Make commands:
- `build` - Builds the Docker images for the project and runs them in docker-compose.
- `up` - Starts the Docker containers.
- `down` - Stops the Docker containers.
- `dev-server` - Starts the development server for backend.
- `dev-client` - Starts the development server for frontend.
- `dev` - Starts the development server for backend and frontend.
- `test` - Runs the tests for the project.
```bash
make
```
### Setup
- Python `3.12`
- Poetry `1.8.2`
- Docker `25.0.0`
- Node.js `20.0.0`
- npm `10.0.0`