ANFIS uses both artificial fuzzy logic and a neural inference system. It has a hybrid approach to estimate the variables, least-square to evaluate the linear variable, and an inaccuracy backpropagation algorithm to estimate dynamical parameters (Kişi 2006). ANFIS is comprised of five levels. The linear parameter is estimated in the first layer(Calp 2019). The idea of fuzzy sets, in which there is no sharp or obvious border, underpins fuzzy logic. Which is multi-valued and deals with degrees of membership and truth, unlike two-valued Boolean logic. In fuzzy logic, a membership value is any logical value from the set of real numbers between 0 (totally false) and 1 (entirely true), and the function that encodes such values is called a membership function. Artificial neural networks' learning ability and relational structure are integrated with fuzzy logic's decision-making process in ANFIS. As with artificial neural networks, ANFIS achieves learning with samples using a train data set. As a result, the most optimal ANFIS structure for solving the associated problem is obtained. The acquired structure is put to the test to see how it reacts to materials it has never seen before (Rao et al. 2020). Membership functions are available in a multitude of shapes, including triangular, trapezoidal, Gaussian, sigmoidal, and so on, and are chosen depending upon the application. Fuzzy logic contains its own set of logical operators, such as AND, OR, NOT, and others (Mekanik et al. 2016). Based on the membership value idea, each of these operations has its meaning. The other key components of fuzzy logic are fuzzy rules, which connect the fuzzy sets. If the rule is correct and the antecedent is correct, the consequent must also be correct, following the IF-THEN rule. As shown in Figure 2, the four phases of a typical fuzzy inference system (FIS) are as follows. (a) Fuzzification of input variables, (b) evaluation of each rule's output, (c) aggregation of several rules' outputs, and (d) defuzzification, which converts fuzzy results into crisp output. The Takagi–Sugeno FIS is one of the most often used FIS types(Ashrafi et al. 2017)(Nourani and Komasi 2013). A fuzzy rule in the Takagi–Sugeno FIS is mostly composed of a linear transformation of crisp inputs rather than fuzzy rules. A typical Takagi–Sugeno FIS rule set contains two fuzzies "IF-THEN" rules.
The following is a representation of a first-order Sugeno fuzzy model (Jang 1993) that has two inputs (x and y) and one output (f), as well as Takagi and Sugeno's two fuzzy IF-THEN rules.
$$RULE-1: if x is {A}_{1} and y is {B}_{1} then {f}_{1}={p}_{1}x+{q}_{1}y+{r}_{1}$$
1
$$RULE-2: if x is {A}_{1} and y is {B}_{1} then {f}_{1}={p}_{1}x+{q}_{1}y+{r}_{1}$$
2
If the premise parameters are (\({p}_{i}{,q}_{i},{r}_{i}\)), the user defines the premise parameters, which must be optimized using the ANFIS training method.
In a fuzzy system with two membership functions, the A1 and A2 represent input x membership functions, while the B1 and B2 represent input y membership functions. Figure 3 shows the ANFIS architecture, which has two input parameters (x, y) and one output parameter (f). It's worth noting that each layer's nodes have the same functions, which are described in the sections below. The output of the layer ith node is represented by the Ol, i.
LAYER 1: Each node I in this layer is an adaptive node, with the following node function
$${O}_{1, i}=\mu {A}_{i}\left(x\right) for i=1, 2$$
3
$${O}_{1, i}=\mu {B}_{i-2}\left(y\right) for i=1, 2$$
4
Where x or y are the noes representing input variables for I and Ai or Bi−2 is a linguistic label (small or large). In other words, \({O}_{l,i}\)specifies the extent to which the provided input x or y meets the quantifier and the membership grade of a fuzzy set A and B (A1, A2, B1, or B2As A's membership function, any appropriate parameterized membership function can be used, including triangular, trapezoidal, Bell, Gaussian, and other forms. This research makes use of a generalized bell-shaped membership function.
LAYER 2: Each node in this layer is a circular junction, and the layer's output is generated using equation 5 as the product of all incoming signals.
$${O}_{2, i}=\text{W}=\mu {A}_{i}\left(x\right)\mu {B}_{i}\left(y\right), i=\text{1,2}$$
5
The rule's firing strength is represented by each node output, indicating that this layer determines the rule's strength.
LAYER 3: Each node decides is a fixed cluster which calculates the following ratio of each ith rule's firing strength to the total of all rule firing strengths
$${o}_{3, i}=\stackrel{-}{{W}_{i}}{f}_{i}=\frac{{W}_{i}}{{W}_{1}+{W}_{2}} , i=\text{1,2}$$
6
LAYER 4: The nodes in this layer are all adaptable, having the function;
$${O}_{3, i}=\stackrel{-}{{W}_{i}}{f}_{i}=\stackrel{-}{{W}_{i}}\left({p}_{i}x+{q}_{i}y+{r}_{i}\right)for i=1, 2$$
7
The succeeding parameters of this layer are pi, qi, and ri, whereas \(\stackrel{-}{{W}_{i}}\) is the normalized firing strength generated from layer 3. These parameters show optimum values after the ANFIS learning algorithm.
LAYER 5: This is the final layer, which contains only one circular node that accumulates all of the incoming signals from layer 4 to determine the overall output which gives is ;
$$Overalloutput={O}_{\text{5,1}}=f=\sum \stackrel{-}{{\omega }_{i}}{f}_{i}=\frac{\sum _{i}{\omega }_{i}{f}_{i}}{\sum _{i}{\omega }_{i}}$$
8
Only the adaptive nodes may be altered based on the user's requirements. All circular nodes are fixed, whereas square nodes are flexible.
The ANFIS method, which employs the Tagaki-Sugeno-Kang (TSK) first-order model, is used here to estimate the rainfall. A hybrid learning algorithm is chosen as a rainfall forecast among the numerous types of supervised learning algorithms. The fact that a multi - task learning algorithm has been widely utilized is a good argument to employ it (Suparta and Samah 2020)(Mosavi et al. 2018)(Sharma and Goyal 2017)(Sai Tarun et al. 2019). One of the benefits of ANFIS is that it mixes ANN and fuzzy systems, generating fuzzy if-then rules with proper membership functions that may learn anything from the imprecise data input and lead to an inference utilizing ANN learning skills. Another advantage is that it can make excellent use of the self-learning capabilities of neural networks and memory capacities, resulting in a more stable training process.
For system identification, fuzzy logic and artificial networks are complementary rather than antagonistic, making their use jointly desirable. In 1993 (Jang 1993)(Karaboga and Kaya 2019) developed the ANFIS by combining these two soft-computing tools and building a Sugeno-type fuzzy inference system to transcend the individual limits of ANN and fuzzy logic (FIS). The ANFIS is an adaptive neuro-fuzzy inference system that combines the recognition and adaption capabilities of an ANN with the decision-making capabilities of a fuzzy logic system. As a result, the ANFIS overcomes the shortcomings of the ANN and FIS techniques and provides a trustworthy system identification method, particularly when the input-output link is complicated. In the ANFIS, a fuzzy model is created first using rules derived from the system's input and output data, and then the neural network is used to fine-tune the fuzzy model's rules to create the best ANFIS model. Seventy-five percent of the data is set aside for training and twenty-five percent for testing. The system's output is checked to see if it matches the given target it was given. If this is not the case, a new network design or learning approach is introduced to improve the learning method. The RMSE (Root Mean Squared Error) is used for testing. If RSME is small enough, ANFIS is considered to have effectively finished the training process.