Views
No views yet
water_potability_model.pkl → Trained Random Forest pipeline (scaler + model)example_usage.py → Example code to use the modelrequirements.txt → Dependencies list1from huggingface_hub import hf_hub_download
2import joblib
3import pandas as pd
4
5# Download and load the trained pipeline
6pipeline_path = hf_hub_download("DarkNeuron-AI/darkneuron-hydrasense-v1", "water_potability_model.pkl")
7model = joblib.load(pipeline_path)
8
9# Example water sample
10sample_data = {
11 'ph': [7.2],
12 'Hardness': [180],
13 'Solids': [15000],
14 'Chloramines': [8.3],
15 'Sulfate': [350],
16 'Conductivity': [450],
17 'Organic_carbon': [10],
18 'Trihalomethanes': [70],
19 'Turbidity': [3]
20}
21
22sample_df = pd.DataFrame(sample_data)
23
24# Predict potability
25prediction = model.predict(sample_df)
26
27print("Prediction:", "💧 Potable" if prediction[0] == 1 else "⚠️ Not Potable")