This assignment involves creating and deploying a Streamlit app to predict purchase intentions using a pre-trained model. We will design an interface, integrate the model, and display predictions with accuracy scores. The app will be deployed on GitHub, tested, and documented.
This app is designed to predict a user's intention to purchase based on several input factors using a Random Forest model. This model was developed and trained in a previous assignment on the subsistence retail dataset. By taking inputs related to customer trust, price sensitivity, perceived product quality, perceived value, shopping frequency, and store layout, the app provides predictions with a confidence score for each user’s likelihood to make a purchase.
The app leverages a Random Forest model stored in a Pickle file, which was trained to predict purchase intentions. This model utilises decision trees to analyse the user's responses and predict purchase intent. Using this model ensures strong performance and reliable predictions based on previously established criteria.
The app interface allows users to easily enter responses for various questions across six categories:
Customer Trust
Price Sensitivity
Perceived Product Quality
Perceived Value
Shopping Frequency
Store Layout
Each question has a 1-5 scale input field that users can adjust based on their preferences or experiences.
When users submit their inputs by clicking the "Predict Purchase Intention" button, the app processes the information through the Random Forest model. It then displays:
Purchase Intention Level (indicating the prediction)
Prediction Confidence (indicating how certain the model is in its prediction)
This output provides both a prediction and a confidence score, making it easy for users to understand the likelihood of their purchase intent.
After viewing the prediction, users have the option to provide feedback on the app's prediction. They can submit their feedback via a text box, which is then stored within the app's session state. Upon feedback submission, users see a confirmation message to thank them for their input.