Skip to content

Latest commit

 

History

History
83 lines (54 loc) · 1.77 KB

README.md

File metadata and controls

83 lines (54 loc) · 1.77 KB

OpenFoodFacts Nutriscore predictor

How to get the dataset

As the dataset is too big to be shared on GitHub, you must download it on OpenFoodFacts (products.csv: 4Go).

Local installation

python -m venv dev
source dev/Scripts/activate
pip install -r requirements.txt

Docker installation

Build the image

docker build --tag app:1.0 .

Access the Streamlit application

docker run --publish 8501:8501 -it app:1.0 -m streamlit run src/app.py

Then access http://localhost:8501.

Access the REST API

docker run --publish 8501:8501 -it app:1.0 src/api.py

Then access http://localhost:8501

Everytime you update the project, you must build a new image with a new tag.

Train the model

  1. Download the RAW data on OpenFoodFacts ;
  2. Execute notebooks/eda.ipynb notebook to clean the data ;
  3. Execute notebooks/feature_encoding_and_selection.ipynb notebook to transform the data ;
  4. Execute src/create_folds.py to prepare data for training ;
  5. Execute src/train.py to train the model ;

Evaluate the performance of the model

python src/report.py --fold=1

fold value is in range [0,4]

report (10th of January, 2022)

Test the machine learning model (Without Docker)

Using a Streamlit Web app

streamlit run src/app.py

Using a REST API

python src/api.py

Quality tools

python -m isort src/
python -m black src/
python -m flake8 src/ --count --statistics

LICENSE

This project is provided under the MIT license.