WasteWise Food Loss and Waste Predictor
The Project
Food loss and waste (FLW), is defined as the reduction of edible food available for human consumption throughout the supply chain, either through losses (e.g., damage, disease, infestation before reaching consumers) or waste (e.g., discarding food that is still fit for consumption). FLW accounts for one-third of all food produced globally and is a significant contributor to carbon emissions and climate change. So to help solve this problem, I decided to build and deploy a machine learning model that is can predict and visualize food loss and waste percentage across different commodities, countries, and supply chain stages, in order to identify trends in the data and predict future food loss and waste.This app uses a decision tree model trained on data from the United Nations Food Loss and Waste Database: https://www.fao.org/platform-food-loss-waste/flw-data/en/ Challenges I faced included dataset cleaning, computation time, and working with the unfamiliar streamlit creator cloud. Since the dataset I chose had over 10,000 data entries for some of the attributes but under 1,000 for others, I decided to only use the former attributes in order to increase the generalizability of my model. Even after this, the dimensionality of the dataset was still quite large, which meant that my grid searches for hyper parameter tuning often took multiple hours, or even failed with the current computation power that I had. To solve this issue, I conducted randomized gridsearches to get as close as possible to the optimized parameters whilst reducing computation time. Finally, I initially struggled to convert my google colab code to a GitHub repository and then to the Streamlit creator cloud, and it was also a completely new learning experience to code the frontend UI of a webapp using Streamlit's software.