Inspiration

With avid travelers in our group, we realized that prices for foods were very different depending on various factors, including location and date. One of our favorite foods including avocados, we decided to focus on avocado prices. Avocado prices have also been increasing due to their health benefits. Therefore, to help farmers decide on a retail price for their products, we have created this program.

What it does

We provide a simple machine learning algorithm that utilizes a random forest regression to predict the price of an avocado-based on various parameters. Our parameters are total volume of avocados, # of small avocados, # of medium avocados, # of large avocados, # of avocados per sale, type of avocado (conventional or organic), year of the sale, and region of the sale (selected from one of 52 possible locations in the US).

The retailer can input these numbers into the fields, and then they can see an approximated per unit retail price!

How we built it

The code was mostly adapted from the official sci-kit learn documentation. After completing the model, we used joblib and flask to create a website to implement our model in a more user-friendly way. We used a YouTube tutorial to help guide us through the steps of implementing flask.

Challenges we ran into

We had two sources of data for our ML algorithm: a more recent, detailed dataset from 2019 to 2021 and an older, less detailed dataset from 2015 to 2018. In order to use both sources, we had to put in the effort and make them compatible. It took some serious Pandas, but we pulled through and managed to make it work!

Accomplishments that we're proud of

We are happy that we were able to not only run machine learning tests on our public data but that we were also able to deploy it into a live web app that is user-friendly.

What we learned

We learned how to deploy a live web app on Flask and implement a machine learning algorithm.

What's next for Project Avocado

As first-time participants of hackathons, we all chose to engage in the emerging track, where we could more easily settle into the system of hackathons. We plan to improve upon our experiences by learning more about the different areas of development that we are interested in, working more efficiently in a team environment, and choosing a more challenging track in future hackathons. Although predicting avocado prices may be at an end for this year, but we are excited to improve and create even more useful and creative programs in the years to come.

Share this project:

Updates