This repository contains two end-to-end Machine Learning applications:
- Household Power Consumption Prediction (Streamlit App)
- Telco Customer Churn Prediction (Tkinter GUI App)
Both projects demonstrate full ML pipelines including preprocessing, training, evaluation, and real-time prediction interfaces.
This Streamlit application trains a Random Forest Regressor on the Household Power Consumption dataset and provides:
- Model training & evaluation
- Interactive visualizations
- Real-time prediction interface
-
📂 Upload dataset (
.txtor.csv) -
🧹 Data preprocessing:
- Combines
Date+Time - Handles missing values
- Combines
-
🌲 Model:
RandomForestRegressor -
📈 Model evaluation:
- Mean Squared Error (MSE)
- Mean Absolute Error (MAE)
- R² Score
-
📊 Visualizations:
- Distribution of
Global_active_power - Actual vs Predicted scatter plot
- Distribution of
-
🔮 Real-time prediction form via Streamlit
pip install streamlit pandas numpy matplotlib scikit-learnstreamlit run app.py- File:
household_power_consumption.txt - Separator:
; - Missing values:
?
- Date
- Time
- Global_active_power (Target)
- Global_reactive_power
- Voltage
- Global_intensity
- Sub_metering_1
- Sub_metering_2
- Sub_metering_3
- Train/Test Split: 80/20
- Model: RandomForestRegressor
- n_estimators: 30
- max_depth: 10
- Scaling: StandardScaler
- Use
SimpleImputerinstead of dropping NaNs - Add feature engineering (hour, day, month)
- Save model using
joblib - Add caching with Streamlit
- Hyperparameter tuning (GridSearchCV)
This desktop application predicts whether a telecom customer will churn using a LightGBM classifier with a simple Tkinter GUI.
It also handles class imbalance using SMOTE.
-
📂 Load CSV dataset and train model instantly
-
⚡ LightGBM classifier (high performance)
-
⚖️ SMOTE for imbalance handling
-
📊 Evaluation metrics:
- Accuracy
- ROC-AUC Score
- Precision
- Recall
- F1-score
-
🔮 Real-time prediction using GUI inputs
pip install pandas scikit-learn imbalanced-learn lightgbmpython churn_gui.py- customerID
- gender
- SeniorCitizen
- Partner
- Dependents
- tenure
- PhoneService
- MultipleLines
- InternetService
- Contract
- PaymentMethod
- MonthlyCharges
- TotalCharges
- Churn (Target)
Only 4 inputs required:
- tenure
- MonthlyCharges
- TotalCharges
- SeniorCitizen (0 = No, 1 = Yes)
tenure = 2
MonthlyCharges = 85
TotalCharges = 170
SeniorCitizen = 1
Prediction: Churn
Probability: 0.67
- Use encoding pipelines for categorical features
- Add model persistence (
joblib) - Improve GUI layout (frames, validation)
- Try additional models (XGBoost, CatBoost)
- Add feature importance visualization
Built as part of supervised machine learning practice projects.