How ukr555/customer_churn_prediction works
Grocery Customer Churn Prediction is a Spring Boot web app: a retailer enters customer details, the app converts them to a customer record, predicts churn, and displays the prediction and risk category. At startup, the prediction service loads customer data and evaluates several Weka algorithms, selecting the best-performing model. The README also describes personalized retention recommendations; their implementation is not shown in the sampled source, so the result page represents this documented capability. The CSV loader’s exact data access is unsampled, so its dataset link is unverified.
Main entry points: ChurnPredictionController.java Prediction controller · ChurnPredictionService.java Churn prediction service · PredictionRequest.java Prediction request · CSVDataLoader.java CSV data loader
Components 13
Web experience
- Spring Boot app
src/main/java/com/grocery/churn/GroceryChurnApplication.java - Prediction controller
src/main/java/com/grocery/churn/controller/ChurnPredictionController.java - Prediction form
src/main/resources/templates/prediction-form.html - Home and about
src/main/resources/templates/index.html - Results and guidance
src/main/resources/templates/prediction-result.html
Prediction domain
- Prediction request
src/main/java/com/grocery/churn/model/PredictionRequest.java - Customer record
src/main/java/com/grocery/churn/model/Customer.java - Prediction result
src/main/java/com/grocery/churn/model/PredictionResult.java
Model training
- Churn prediction service
src/main/java/com/grocery/churn/service/ChurnPredictionService.java - CSV data loader
src/main/java/com/grocery/churn/util/CSVDataLoader.java - Customer dataset
src/main/resources/data/grocery_customers.csv - Model evaluation and selection
src/main/java/com/grocery/churn/service/ChurnPredictionService.java
Other components
- Retailer
Connections 14
- Retailer → Prediction controller: submits details
src/main/java/com/grocery/churn/controller/ChurnPredictionController.java - Prediction controller → Prediction form: serves form
src/main/java/com/grocery/churn/controller/ChurnPredictionController.java - Prediction controller → Home and about: serves pages
src/main/java/com/grocery/churn/controller/ChurnPredictionController.java - Prediction controller → Prediction request: binds input
src/main/java/com/grocery/churn/controller/ChurnPredictionController.java - Prediction request → Customer record: converts to
src/main/java/com/grocery/churn/model/PredictionRequest.java - Prediction controller → Churn prediction service: requests prediction
src/main/java/com/grocery/churn/controller/ChurnPredictionController.java - Prediction controller → Results and guidance: serves results
src/main/java/com/grocery/churn/controller/ChurnPredictionController.java - Churn prediction service → CSV data loader: loads data through
src/main/java/com/grocery/churn/service/ChurnPredictionService.java - CSV data loader → Customer dataset: loads from
- Churn prediction service → Customer record: trains and predicts
src/main/java/com/grocery/churn/service/ChurnPredictionService.java - Churn prediction service → Model evaluation and selection: evaluates models
src/main/java/com/grocery/churn/service/ChurnPredictionService.java - Churn prediction service → Prediction result: returns result
src/main/java/com/grocery/churn/service/ChurnPredictionService.java - Prediction controller → Prediction result: passes result
src/main/java/com/grocery/churn/controller/ChurnPredictionController.java - Spring Boot app → Churn prediction service: initializes at startup