Random Forest was selected for its strong resistance to overfitting and balanced performance across all evaluation metrics.
Predicted solar irradiance (W/m²) is converted to power generation (kWh) using
pvlib.
1from huggingface_hub import hf_hub_download
2from pycaret.regression import load_model, predict_model
3import pandas as pd
4
5# Download model from Hugging Face Hub
6model_path = hf_hub_download(
7 repo_id="ryukkt62/Suncast",
8 filename="Suncast_v1.pkl"
9)
10
11# Load PyCaret pipeline (strip .pkl extension)
12model = load_model(model_path.replace(".pkl", ""))
1# Prepare input features
2input_data = pd.DataFrame([{
3 "sp": 101325, # Surface Pressure [Pa]
4 "t": 300.15, # Surface Temperature [K]
5 "r2": 60.0, # Relative Humidity [%]
6 "u10": 2.0, # U-Wind [m/s]
7 "v10": -1.5, # V-Wind [m/s]
8 "SUNSD": 3200, # Sunshine Duration [s]
9 "lcc": 10.0, # Low Cloud Cover [%]
10 "mcc": 5.0, # Mid Cloud Cover [%]
11 "hcc": 20.0, # High Cloud Cover [%]
12 "sdswrf": 650.0, # DSWRF [W/m²]
13 "hour_local": 12,
14 "month_local": 7,
15 "day_of_year": 190
16}])
17
18# Predict irradiance → PV power
19prediction = predict_model(model, data=input_data)
20print(prediction["prediction_label"])
This model is released under the
Apache 2.0 License.