## 3 ANFIS-Based Modeling  
The ANFIS is a powerful hybrid modeling approach that combines the learning capabilities of artificial neural networks with the qualitative reasoning of fuzzy logic. It is particularly well-suited for modeling complex, non-linear systems where traditional analytical methods fall short. By integrating fuzzy if-then rules with data-driven training, ANFIS can capture both expert knowledge and experimental trends, offering high interpretability and accuracy. Its layered architecture allows it to adapt membership functions and rule parameters through training, making it an effective tool for prediction, system identification, and optimization tasks in various engineering applications, such as the prediction of surface roughness, cutting forces, and temperatures during machining [37; 38; 39; 40]. The structure of an ANFIS model relies heavily on the definition and configuration of membership functions (MFs), which are fundamental components used to fuzzify the input variables. Each MF represents a linguistic label (e.g., \"low\", \"medium\", and \"high\") and determines how the input values are mapped into fuzzy sets. In this study, a systematic evaluation of ANFIS structures was performed using four commonly used MF types [41]: triangular, trapezoidal, Gaussian, and generalized bell-shaped. These types were chosen for their widespread application, simplicity, and flexibility in representing smooth transitions across input ranges. Twelve combinations were tested for each model, varying the number of MFs per input across 2-2-2, 3-3-3, and 4-4-4 structures. It was found that the triangular MF with a 3-3-3 configuration resulted in the lowest Root Mean Square Error (RMSE) and higher R\({}^{2}\), indicating superior predictive performance. RMSE is a metric sensitive to outliers, whereas R\({}^{2}\) measures how well predictions explain the variance in the data (closer to 1 is better). Increasing the number of MFs beyond four per input led to model overfitting and higher RMSE, whereas reducing them to two per input (2-2-2) resulted in underfitting  
Figure 4: Scatterplot for the correlation between the measured surface roughness and the temperature. and poor accuracy. Therefore, the selected configuration strikes a balance between model complexity and generalization, providing an optimal structure for capturing the underlying patterns in the machining data. The training epochs were set to 30 for all trials since each combination required a different number of epochs for the training RMSE to stabilize. Table 3 presents the findings of the trials for Model I, which relates to \(Ra\), and Model II, which corresponds to temperature. Figure 5 illustrates the proposed ANFIS structure based on the rules established by [PERSON] and [PERSON] [42]. The training processes and establishment of the models were achieved by utilizing the Fuzzy Logic toolbox of MATLAB R2021a. The first layer is responsible for computing the membership degrees using MFs. The second layer is used to calculate the firing strengths, whereas the third layer normalizes the firing strengths. Inside the fourth layer, the output of rules is calculated using linear functions. Finally, the weighted average of all rule outputs is calculated in the fifth layer. In the first layer, each node is an adaptive node that computes the membership grade of an input using an MF such as triangular, Gaussian, or bell-shaped. This way, the numerical inputs are converted into fuzzy rules. These outputs can be determined with Equation (1),  
Figure 5: The selected structure of the proposed ANFIS model.