## Materials and Methods
### ANN Structure, Training Algorithm, and Feature Input Selection  
ANN is a supervised machine learning that can be trained to map the relation between input/feature and the target/output by adjusting the weights and biases between neuron elements [22]. This highly nonlinear mapping can be applied in many areas, including multivariable regression. There are different types of ANNs structure and training algorithms. Among the common types are cascade-forward neural networks (CFNN), multi-layer feed-forward neural networks (FFNN) and recurrent neural networks. In this study, both FFNN and CFNN structures were implemented, and their effectiveness was compared and evaluated. The programming execution was performed in MATLAB 2019b software. The structure CFNN is similar to FFNN, but the key difference between the two is that CFNN include a connection from the input to the neurons in the following hidden layers. The advantage of this approach is that it accommodates the nonlinear input-output relationship without eliminating the \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multicolumn{3}{c}{**Target Variable**} & \multicolumn{5}{c}{**Input Variables (Features)**} \\ \hline \hline
**Name of** **Variable** & **River Flow** & **Weighted Rainfall** & **Average Evaporation** & **Min of Temperature** & **Mean of Temperature** & **Max of Temperature** \\ \hline
**Unit** & cms & Mm & mm & \({}^{\circ}\)C & \({}^{\circ}\)C & \({}^{\circ}\)C \\ \hline
**Notation** & \(y\) & \(x_{1}\) & \(x_{2}\) & \(x_{3}\) & \(x_{4}\) & \(x_{5}\) \\ \hline
**Duration** & & & & 1988–2016 & & \\ \hline
**Location** & & & Kuala Krai city downstream & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Variables and their attributes. linear relationship between the two [23]. FFNN is a standard structure for a multi-layer neural network which can be found in many works of literature. Additionally, FFNN is a further modification of FFNN where additional weights are connected from the input nodes to the hidden nodes, and output nodes, as shown in the upper portion of Figure 2. These additional weights do not exist in the standard FFNN. The different networks structure between CFNN and FFNN in terms of weight connection can also be seen in the study [7; 24]. Detailed computation works about the application of the training algorithms can be found in [7; 25]. The output of the CFNN was expressed as:  
\[\hat{y}_{k}(x,w)\ =\ \sum_{i}\varphi(w_{i}x_{i})+\varphi\left(\sum_{h}w_{kh} \varphi\left(\sum_{j}w_{h}\varphi\left(\ldots\varphi\left(\sum_{i}w_{li}x_{i}+ b_{i}\right)\right)+b_{i}\right)+b_{h}\right) \tag{2}\]  
where \(\varphi(\cdot)\) is the selected activation function, \(w_{kh}\) is the weight strength from a neuron in the last hidden layer \(h\) to the single output neuron \(k\), and so on, for other weights' strength. \(x_{i}\) is the \(i\)th element of the input/features variable and \(b_{i}\) is the bias weight in the neurons of the first hidden layer, and so on. The symbol \(w\) denotes the weight vector for the entire set of all weights ordered by layer, followed by neurons in a layer and then signal strength in a neuron. Hence, in this study, 1 or 2 hidden layers of ANN were used for the evaluation. The activation function selected for the hidden layer(s) and the output layer is the tangent sigmoid and linear function, respectively. The tangent sigmoid function can be expressed as:  
\[\varphi(I_{i})\ =\ \frac{2}{1+e^{-2I_{i}}}-1 \tag{3}\]  
where \(I_{i}\) is the signal coming into the neuron in hidden layers. For the linear function in the output layer, it can be expressed as follows:  
\[\varphi(I_{k})\ =\ I_{k} \tag{4}\]  
where \(I_{k}\) is the input to the neurons in the output layer. Figure 2: Illustration of the cascade-forward neural network (CFNN) structure used in this study [7]. Furthermore, ANN is usually trained using the backpropagation (BP) algorithm and its variations.