Water Potability Analyzer is a machine learning-powered web application that predicts whether water is safe for consumption based on 9 key water quality parameters.
The system uses a Random Forest Classifier along with data preprocessing and feature analysis to provide accurate predictions and actionable insights.
👉 Designed for real-world applications like:
- Water quality monitoring
- Environmental analysis
- Public health assessment
| Component | Details |
|---|---|
| Model | Random Forest Classifier |
| Features | 9 Water Quality Parameters |
| Preprocessing | Missing value imputation + StandardScaler |
| Optimization | GridSearchCV |
| Evaluation | Cross-validation + Accuracy Score |
- pH
- Hardness
- Total Solids
- Chloramines
- Sulfate
- Conductivity
- Organic Carbon
- Trihalomethanes
- Turbidity
✔️ Manual parameter input for prediction
✔️ Natural language-based water analysis
✔️ Batch prediction using CSV upload
✔️ Feature importance & RFE analysis
✔️ Data visualization & insights dashboard
✔️ Water Quality Index (WQI) categorization
✔️ Interactive charts using Plotly
- 📊 Real-world water quality dataset
- 🧪 9 chemical parameters
- 🏷️ Target: Potability (Safe / Unsafe)
- 📌 Missing values handled using mean imputation
| Layer | Technology |
|---|---|
| Frontend | Streamlit |
| Backend | Python |
| ML Libraries | Scikit-learn |
| Data Processing | Pandas, NumPy |
| Visualization | Plotly, Matplotlib, Seaborn |
| Model Persistence | Pickle |
- 📝 User inputs parameters / description / CSV
- ⚙️ Data preprocessing (scaling + cleaning)
- 🌲 Random Forest model predicts potability
- 📊 Probability and confidence score generated
- 📈 Results visualized using interactive charts
- 💡 Recommendations provided based on prediction
- Compared multiple models (Logistic Regression, SVM, KNN, Decision Tree, Random Forest, etc.)
- Selected Random Forest based on best performance
- Applied GridSearchCV for hyperparameter tuning
- Used Stratified Train-Test Split for balanced evaluation
- Achieved strong classification performance
📌 Training & model pipeline implemented → :contentReference[oaicite:0]{index=0}
git clone https://github.com/puniaiml/Water-potability-analysis.git
cd Water-potability-analysis
pip install -r requirements.txt
streamlit run app.py



