Wire electrical discharge machining (WEDM) is one of the most commonly used non-conventional machining processes in the aerospace, nuclear, and precision industries. This technology possesses numerous advantages over traditional machining processes due to its superior properties, such as high precision of machined surfaces, ease of machining of complex shapes, and hard material processing. This study focuses on investigating the performance characteristics of Mg-SiC nanocomposite through experimental analysis using WEDM, with surface roughness as the key evaluation parameter. Employing a fractional factorial design, twenty-five experimental datasets were generated to explore the impact of WEDM machining parameters, including Pulse on time (Ton), Pulse off time (Toff), Servo voltage (SV), and Peak current (Ip), on surface roughness. Leveraging a machine learning approach, specifically, Support Vector Regression (SVR) integrated with Genetic Algorithms (GA) and Particle Swarm Optimization (PSO), an integrated predictive surface roughness model for machined substrates was developed. The predicted results exhibited a high level of agreement with experimental data, boasting a coefficient of determination (R2) value of 0.866 and a mean square error (MSE) of 0.364. A novel aspect of this work lies in integrating GA-PSO with SVR to obtain optimized surface roughness values. Through this methodology, SVR-GA and SVR-PSO achieved optimum surface roughness values of 0.187 μm and 0.132 μm, respectively, with SVR-PSO demonstrating superior performance by outperforming SVR-GA after 360 and 428 iterations, respectively. Thus, this study presents a novel and effective approach to optimizing surface roughness values in WEDM processes.