Logo Lanfrica

JulietOrnellas/water-pump

Domain:

environment and energy

Record type:

project
Creator:
Jul
Host:
Predicting the operational status of water pumps in Tanzania using machine learning. # πŸ’§ Water Pump Functionality Prediction This project predicts the operational status of water pumps using machine learning. We preprocess the data, train models including Decision Tree and Random Forest classifiers, and tune hyperparameters to improve prediction accuracy. --- ## πŸ“Œ Project Overview Access to clean water is a major challenge in many regions. This project builds a multiclass classification model to predict whether a water pump is: - **Functional** - **Non-functional** - **Functional but needs repair** By accurately identifying pump status, NGOs and local governments can prioritize maintenance and improve water access. --- ## πŸ“‚ Dataset This project uses the DrivenData Water Pump Challenge dataset, which contains: - `data/train_features.csv`: Training data with features. - `data/train_labels.csv`: Corresponding labels for training. - `data/test_features.csv`: Test data for which we generate predictions. The dataset includes features such as location, installer, construction year, water quality, and pump type. Some columns had too many unique categories or redundant values, so they were cleaned or dropped during preprocessing. A custom `wrangle()` function was used to remove high-cardinality and duplicate features to improve model performance. --- ## πŸš€ How to Use This Repository 1. Run the Jupyter notebook `water-pump.ipynb` to reproduce the analysis, training, and generate predictions. 2. The predictions file `output/predictions.csv` will be created after running the model. --- ## πŸ”§ Key Features - βœ… Custom `wrangle()` function for data cleaning and preprocessing - πŸ“Š Automated Exploratory Data Analysis using `ydata_profiling` - πŸ”„ Train-validation splitting with baseline accuracy evaluation - 🌳 Decision Tree classifier pipeline with hyperparameter tuning on tree depth - 🌲 Random Forest classifier with hyperparameter tuning and cross-validation - πŸ“ˆ Feature importance visualization based on Gini importance scores - πŸ”Ž Randomized search for …