--- language: en license: mit library_name: pytorch tags: - regression - synthetic-data - solar-energy --- # Solar Linear Regression Model trained by `_june-17/solar_linear_regression.py`. PyTorch linear regression predicting daily solar energy output (kWh). ## Dataset Synthetic Colorado solar dataset generated by `_june-17/generate_solar_dataset.py`. - **Size:** 500 rows - **Target:** `daily_energy_kwh` (20.44 – 61.03 kWh) | Feature | Min | Max | |---|---|---| | `day_of_year` | 1.00 | 365.00 | | `sun_hours` | 4.02 | 8.50 | | `cloud_cover_pct` | 0.40 | 59.90 | | `panel_temp_c` | 5.30 | 70.00 | | `system_size_kw` | 3.01 | 11.99 | ## Performance - Val R²: ~0.997 - Val RMSE: ~0.48 kWh ## Files - `solar_best.pt` — model weights, normalization stats, feature names - `solar_linear_regression.py` — training script ## Usage ```python import torch from solar_linear_regression import LinearRegressionModel ckpt = torch.load("solar_best.pt", map_location="cpu") model = LinearRegressionModel(len(ckpt["feature_cols"])) model.load_state_dict(ckpt["model_state_dict"]) model.eval() ``` Normalize input with `ckpt["X_mean"]` / `ckpt["X_std"]`, then denormalize output with `ckpt["y_mean"]` / `ckpt["y_std"]`. ## Limitations Synthetic dataset; not based on real measured solar production.