This repository was created for the machine-learning forecasters that predict net radiation using minimum weather information, e.g., temperature. It pulls data from the National Weather Service (NWS) API for customized location and forecasts the net radiation.
- The model built was based on five popular machine learning algorithms, including multi-linear regression, K nearest neighbor, support vector machine, random forests, and gradient boosted tree regression.
- The dataset for model construction was collected from the CIMIS and AZMET from 1982 to 2018.
- Extracting ERA5 reanalysis global climate dataset for forecast validation.
- Forecasting 7-day net radiation from the running date after automatically extracting weather forecasting information from NWS.
Figure 1. Geographical location of observation station
import nws_forecast
from nws_forecast import forecast
# request weather forecast from NWS
my_forecast = forecast(city="Merced, CA", model_type ='lm')
my_forecast.request_nws()
# proceed the forecast and plot the forecast results
from class_model import model
my_forecast.export_forecast()
my_forecast.plot_forecast()
An expected output is shown below:
Figure 2. Net radiation forecasting at Merced, CA
Figure 3. Theoretical, predicated, and observed net radiation against time using a Gradient Boosted Tree Model at one location in California.
Figure 4. Predicted against observed net radiation using a Random Forest Model for all stations in California and Arizona.