Downloads · 30 days
0
bajiang/Electricity_Price_Predictor_Random_Forest_Regression
Electricity_Price_Predictor_Random_Forest_Regression is a machine learning model from bajiang. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for scikit-learn. The card lists the license as mit.
This is a custom regression model trained to predict electricity prices ($/kWh) in California, based on a variety of grid-level and environmental features such as EV charging demand, solar/wind production, carbon emis…
Downloads · 30 days
0
Access
Public
Updated May 14, 2025
Repo size
435 MB
Likes
2
Public
Click a slice to open those files.
.pkl435 MB · 99%
From the Hugging Face model README
This is a custom regression model trained to predict electricity prices ($/kWh) in California, based on a variety of grid-level and environmental features such as EV charging demand, solar/wind production, carbon emissions, and storage indicators.
The model is trained using RandomForestRegressor from scikit-learn, with 24 engineered features and a structured tabular dataset. This project is intended to support intelligent energy systems, such as EV charging optimization, energy scheduling, or smart grid simulation.
The model expects a list of 24 numeric features:
['Year', 'Month', 'Day', 'DayOfWeek', 'Hour',
'EV Charging Demand (kW)', 'Solar Energy Production (kW)', 'Wind Energy Production (kW)',
'Battery Storage (kWh)', 'Charging Station Capacity (kW)', 'EV Charging Efficiency (%)',
'Number of EVs Charging', 'Peak Demand (kW)', 'Renewable Energy Usage (%)',
'Grid Stability Index', 'Carbon Emissions (kgCO2/kWh)', 'Power Outages (hours)',
'Energy Savings ($)', 'Total_Renewable_Energy_Production', 'Effective_Charging_Capacity',
'Adjusted_Charging_Demand', 'Net_Energy_Cost', 'Carbon_Footprint_Reduction',
'Renewable_Energy_Efficiency']
import joblib
import numpy as np
# Load trained model
model = joblib.load("random_forest_model.pkl")
# Sample input (replace with actual values)
features = [0.5] * 24
# Make prediction
price = model.predict(np.array(features).reshape(1, -1))[0]
print(f"Predicted Electricity Price: ${price:.4f}")
predict.pyfrom predict import predict
features = [0.5] * 24
result = predict(features)
print(f"Predicted Price: ${result:.4f}")
If deployed, you can try it here:
👉 Live Demo on Spaces
This repository includes a sample dataset: processed_electric_price_filled.csv.
It contains hourly records of EV charging demand, solar/wind energy production, grid stability, and electricity prices.
import pandas as pd
df = pd.read_csv("processed_electric_price_filled.csv")
print(df.head())
| File | Description |
|---|---|
random_forest_model.pkl | Trained RandomForestRegressor model |
predict.py | Python function to load and run predictions |
app.py (optional) | Gradio-based interactive demo |
requirements.txt | Python dependencies |
processed_electric_price_filled.csv | Training/test dataset |
README.md | This documentation |
bajiang(Georgia)
MIT License – You are free to use, modify, and distribute this project with proper attribution.