Views
No views yet
water_model.joblib.pip install scikit-learn xgboost joblib huggingface_hub1from huggingface_hub import hf_hub_download
2import joblib
3
4# Download model and features
5model_path = hf_hub_download(
6 repo_id="codealchemist01/ecologia-water-model",
7 filename="water_model.joblib",
8 token="YOUR_HF_TOKEN" # Optional if public
9)
10
11features_path = hf_hub_download(
12 repo_id="codealchemist01/ecologia-water-model",
13 filename="water_features.joblib",
14 token="YOUR_HF_TOKEN" # Optional if public
15)
16
17# Load model and features
18model = joblib.load(model_path)
19feature_columns = joblib.load(features_path)1import pandas as pd
2import numpy as np
3
4# Prepare input data (example)
5input_data = pd.DataFrame({
6 'building_type': ['Office'],
7 'area_sqm': [1000],
8 'year_built': [2020],
9 'temperature': [20.5],
10 'humidity': [65],
11 'hour': [14],
12 'day_of_week': [1],
13 'month': [6],
14 # ... other required features
15})
16
17# Ensure all features are present
18for col in feature_columns:
19 if col not in input_data.columns:
20 input_data[col] = 0
21
22# Select features in correct order
23input_data = input_data[feature_columns]
24
25# Make prediction
26prediction = model.predict(input_data)
27print(f"Predicted water_consumption (liters): {prediction[0]:.2f}")1@software{ecologia_energy_model,
2 title = {Ecologia Water Consumption Model},
3 author = {Ecologia Energy Team},
4 year = {2024},
5 url = {https://huggingface.co/codealchemist01/ecologia-water-model},
6 note = {Trained on Building Data Genome Project 2 dataset}
7}