Logo Lanfrica

Haiubabdelkader99/water-pump-predictor

Domain:

environment and energy

Record type:

project
Creator:
Hai
Host:
Prediction of the functional status of water pumps in Tanzania β€” a Machine Learning project using Random Forest (DrivenData) # πŸ’§ Water Pump Predictor - Tanzania **Machine Learning app to predict the operational status of water pumps in Tanzania**, based on the DrivenData "Pump It Up" challenge. --- ## Project Overview / DescripciΓ³n del Proyecto ## πŸ“Œ Project Overview This app uses a trained `Random Forest` model to classify water pumps as: - βœ… `functional` - ⚠️ `functional needs repair` - ❌ `non functional` It features a full ML pipeline, from preprocessing to prediction, live evaluation and interactive dashboards. --- ## Final Score / Resultado Final ## πŸš€ Try it Online You can test the live app hosted on **Streamlit Cloud**: --- ## 🧠 Model & Techniques Used - RandomForestClassifier (Scikit-learn) - KNNImputer for missing values - TargetEncoder for categorical variables - LabelEncoder for final mapping - Feature importance visualization - Geo-mapping with Pydeck --- ## 🧭 App Functionalities ### πŸ” 1. Prediction Mode - Upload a test dataset (`Testsetvalues.csv`) - Predict status using the trained model - Download enriched CSV with predictions - Interactive prediction map ### πŸ“Š 2. Evaluation Mode - Upload training and label datasets - Shows classification report + confusion matrix - Validates the model's performance on full data ### πŸ“ˆ 3. Interactive Dashboard - Upload prediction results (`predictions_full.csv`) - Filter by `region`, `status`, or `construction_year` - Explore data visually + map filtered results --- ## πŸ—‚οΈ Project Structure ``` πŸ“ water-pump-predictor/ β”œβ”€β”€ app_v4_final.py # Streamlit App (v4 with all features) β”œβ”€β”€ model_rf.joblib # Trained RandomForest model β”œβ”€β”€ target_encoder.joblib # Encoder for categorical vars β”œβ”€β”€ knn_imputer.joblib # Fitted KNN imputer β”œβ”€β”€ final_columns.joblib # Ordered feature columns β”œβ”€β”€ Trainingsetvalues.csv # Training data β”œβ”€β”€ Trainginsetlabels.csv # Labels for training data β”œβ”€β”€ Testsetvalues.csv # Data to predict β”œβ”€β”€ predictions_full.csv …