💡 Inspiration
As broke university students, we want to be better at managing our money.
We have friends who rely on retail therapy for stress relief and we would like to help them better manage their finances. However this ends up costing a lot of money and sometimes people buy things they end up not wanting. We wanted to tackle this problem to help our friends :D
🔍 What it does
In retail therapy people often end up spending a lot of money on purchases they later find to not be useful or satisfactory. They also easily spend large amounts of money without realizing it. The goal of our application is to help our user visualize the quantity of money they have spent, set goals, and make better decisions on whether they should buy an item or not.
The first step is data collection, where we developed a simple purchase tracking application to allow the user to keep track of their purchases and expenditure, along with other purchase information.
Then we plug the data into an ML model to try and estimate how satisfied they would be with the purchase, to help them better decide if the purchase is worth it based on their shopping history and demographic. This helps reduce expenditure on items that have little value to the user.
🔧 How we built it
Data collection with MongoDB Atlas as database, .NET MAUI as the frontend, and .NET webAPI as the backend to communicate between the two. We used Swagger and later Postman to test that the API could be accessed and figure out the format of data to send in order to write and read data from the database. Then we wrote our MAUI application to connect with our .NET webAPI on localhost.
Our backend and frontend can be found on our repository as ShopOrDropAPI and ShopOrDropApp accordingly
We generated data using Excel to generate simulated user inputs, where we tried to make realistic values, as we did not have the time to collect the full data needed to train our model. We then split our data into train-test sets. The goal was to use a .NET ML model to generate the estimated satisfaction value for a given product
We tried two different methods of creating our ML model, the first one with Microsoft.ML package in C#. Through this we learnt how to encode our variables and analyze model metrics. We then tried the ML.NET Model Builder in Visual Studio, which allows us to more easily generate the model using the Model Builder's GUI, and automatically generate the code to integrate it with a .NET webAPI, making it easier to integrate.
The attributes used for the model were: dayOfWeek, category, itemCost, onlinePurchase, and the predicted variable is the Satisfaction
We also tested a model where the predicted variable is a binary variable of whether the user
The models can be found in our repository.
Finally, we managed to fully integrate the ML model into our main API and run it via an end point, connecting it to the frontend.
🏃♂️ Challenges we ran into
- It was our first time using .NET, and we had no experience with the different frontend options (eg Razor, Blazor, and ASP.NET). We spent a few hours of trial and error to try out the different options, then ended up deciding to try MAUI since it was newer.
- We encountered a lot of issues trying to set up the backend API in .NET trying to serve data that we had successfully pulled from MongoDB. Thankfully we managed to find a workaround in time.
- It was our first time using MongoDB's Atlas, and we had to figure out how to connect to it using its API. We confused it with MongoDB's Realm documentation for a while, but managed to find a working solution by reading through the function definitions in the source code.
- It was our first time using ML.NET, but we managed to figure out how to use it and build our models.
- We did not understand how to integrate the ML.NET model into our main API at first, and it took a lot of trial and error to figure out how to create data models to property receive and display the predicted data.
🏅 Accomplishments that we're proud of
We managed to create a frontend app with MAUI and integrated it with our MongoDB database We managed to learn how to use ML.NET, which was initially a stretch goal for our project We managed to push through and integrate the predictive model into our API and our frontend very close to the end despite many bugs and issues
🧠 What we learned
We tried a new full stack of different technologies
- MongoDB Atlas
- To host our data
- .NET
- MAUI
- For the front end application, where we also learned to use xaml files
- webAPI
- To communicate with our front end and retrieve data from MongoDB Atlas
- Swagger
- To test our webAPI
- Microsoft.ML package in C# & ML.NET Model Builder
- To predict the satisfaction level of a user if they buy a product.
- MAUI
It was also our first time writing a web application and API with C#.
⏭️ What's next for Shop or Drop
- Allow updates to purchased items (update name, price, satisfaction level etc)
- Improve front-end UI and add more pages to see charts/graphs of growth and decrease in expenses over time
- Deletion of user data from the database
- Better security for password checking
- Improvement of the ML predictive model
- Training the model on more data, and using data cleaning to ensure the data is suitable
- Exploring more models and using more meaningful features and cross validation
- Expansion of features
- using clustering to predict categories of future expenses
- predicting monthly expenses
- Adding demographic data of the user if the user does not have enough data points to train the model alone, to improve accuracy - income bracket, education level, household size, employment status
- comparison of user’s expenses against other users from the same income bracket
Log in or sign up for Devpost to join the conversation.