File size: 2,365 Bytes
7bcc90f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
802671b
 
 
 
7344c33
802671b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e4c7716
 
802671b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e4c7716
802671b
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
license: mit
language:
- en
metrics:
- accuracy
- precision
- recall
- f1
- confusion_matrix
pipeline_tag: tabular-classification
library_name: sklearn
tags:
- Water Potability
- Random Forest
- Standard Scaler
---

# πŸ’§ HydraSense - Water Potability Classifier Model (v1.0)

A lightweight **Random Forest + StandardScaler** based water potability prediction model developed by **DarkNeuronAI**.  
It classifies water as **Potable (1)** or **Not Potable (0)** based on chemical and physical features β€” ideal for simple tabular classification tasks.

---

## πŸš€ Features
- Fast and efficient β€” runs easily on standard laptops  
- Trained with real-world water quality datasets  
- Predicts potability from features like **pH, Hardness, Solids, Chloramines, Sulfate, Conductivity, Organic Carbon, Trihalomethanes, Turbidity**  
- Uses a **pipeline** to automatically scale and preprocess input data  
- Easy to use and integrate

---

## πŸš€ Model Overview
- **Algorithm:** Random Forest Classifier  
- **Preprocessing:** StandardScaler (automatic feature scaling)  
- **Goal:** Predict whether water is safe to drink (Potable) or unsafe (Not Potable)  
- **Performance:** Accurate classification on real-world datasets  

---

## 🧩 Files Included
- `water_potability_model.pkl` β†’ Trained Random Forest pipeline (scaler + model)  
- `example_usage.py` β†’ Example code to use the model  
- `requirements.txt` β†’ Dependencies list  

---

## 🏷️ Prediction Labels (Binary)
- **0:** Not Potable (Unsafe to drink)  
- **1:** Potable (Safe to drink)  

---

## πŸ’‘ How to Use (Example Code)
```python
from huggingface_hub import hf_hub_download
import joblib
import pandas as pd

# Download and load the trained pipeline
pipeline_path = hf_hub_download("DarkNeuron-AI/darkneuron-hydrasense-v1", "water_potability_model.pkl")
model = joblib.load(pipeline_path)

# Example water sample
sample_data = {
    'ph': [7.2],
    'Hardness': [180],
    'Solids': [15000],
    'Chloramines': [8.3],
    'Sulfate': [350],
    'Conductivity': [450],
    'Organic_carbon': [10],
    'Trihalomethanes': [70],
    'Turbidity': [3]
}

sample_df = pd.DataFrame(sample_data)

# Predict potability
prediction = model.predict(sample_df)

print("Prediction:", "πŸ’§ Potable" if prediction[0] == 1 else "⚠️ Not Potable")
```

# Developed With ❀️ By DarkNeuronAI