## 2 Materials and Methods
### Machine Learning for Irradiance Forecasting  
Machine Learning (ML) is now ubiquitous in all areas of engineering and data science. It has been used in many different ways to help solve the solar power forecasting problem, as described in [51; 52]. Another area where ML is widely used is forecasting building load [53; 54] which includes methods that are physics-based, statistics-based (Gaussian Process, Linear Regression), and use machine learning (Artificial Neural Network, Support Vector Machine, Deep Learning). Classic references for Deep Learning include [55; 56; 57] and for Convolutional Neural Networks, [58]. AI software for data mining has evolved dramatically over the last few years. In data analytics Python is the premier programming language [59] and this fully validated our decision to use it for the Skylmager project. Rapidminer (Version 8.1.001) [60] is a machine learning platform with a point and click interface. As shown in Figure 14, a data flow pipeline is established that permits the user to input a data set, select attributes to analyze, determine target and predictor variable roles, partition the data into training, validation, and sometimes testing subsets, create a logical fork to apply different subprocess models such as Random Forests or Deep Learning, run the model(s), and assess error metrics and overall performance. It is a proprietary package, but a version with somewhat reduced functionality is available for educational use. For some models Rapidminer utilizes the H2O machine learning modules (Version 3.8.2.6) [61; 62]. Specifically, our Deep Learning (DL) model is found in H2O as the Python function H2 ODeepLearningEstimator(). An open source Python package Scikit-Learn (Version 0.19.0) [63] allows a user to prototype and compare a variety of classification, clustering, and regression models. Neural networks and deep learning has seen the evolution of specialized software such as Keras, Theano, and Google's Tensorflow, which recently became open source. The computational demands of training networks on big data are extreme, and this has resulted in a hardware evolution from central processing units (CPU) to graphical processing units (GPU) to special purpose tensor processing units (TPU). Figure 13: Image Processing Pipeline. Before predicting irradiance for cloudy days, consider the much simpler problem of forecasting on a clear day. The Haurwitz analytic model performs well on days with no clouds. Using physics, one can derive a closed-form functional relationship [64]: \(\text{GHI}_{\text{clr}}=1098\) [\(\text{cos}\theta_{z}\)\(\text{exp}(-0.057/\text{cos}\theta_{z})\)], where \(\theta_{z}\) is the solar zenith angle. Can neural networks learn this relationship, given a large enough dataset on which to train? The actual forecasting problem on a cloudy day is of course much harder. Information in each all-sky image is used to locate and track low-level cumulus clouds as they move between the sun and PV-arrays. It is the difference between using ML to recognize machine-written (or even hand-written) digits versus recognizing and identifying faces in a crowd of people moving down the street. Work is ongoing to identify the best features to extract from the images, to efficiently solve the intra-hour solar forecasting problem and to predict very short-term ramp events. A critical component of any machine learning strategy is deciding which features or input variables are most strongly correlated with the labels or output variables. A second aspect involves finding a representation of the data that is compressed or sparse in some basis. This dimensionality reduction [65] can be achieved through principal component analysis (PCA) or by the simple process of discarding unimportant features in the inputs. In our studies, the label or target variables were scalars: GHI values measured atop the ESIF Building at NREL. Other choices are possible such as the value \(\text{GHI}_{\text{clr}}-\text{GHI}_{\text{mea}}\), the deviation from the clear sky value.