In this study, we solve the challenge of predicting oil recovery factor (RF) in layered heterogeneous reservoirs after 1.5 pore volumes of water-, gas- or water-alternating-gas (WAG) injection. A dataset of ~2500 reservoir simulations is analyzed based on a Black Oil 2D Model with different combinations of reservoir heterogeneity, WAG hysteresis, gravity influence, mobility ratios and WAG ratios. In the first model MOD1, RF is correlated with one input (an effective WAG mobility ratio M*). Good correlation (Pearson coefficient −0.94), but with scatter, motivated a second model MOD2 using eight input parameters: water–oil and gas–oil mobility ratios, water–oil and gas–oil gravity numbers, a reservoir heterogeneity factor, two hysteresis parameters and water fraction. The two mobility ratios exhibited the strongest correlation with RF (Pearson coefficient −0.57 for gas-oil and −0.48 for water-oil). LSSVM was applied in MOD2 and trained using different optimizers: PSO, GA, GWO and GSA. A physics-based adaptation of the dataset was proposed to properly handle the single-phase injection. A total of 70% of the data was used for training, 15% for validation and 15% for testing. GWO and PSO optimized the model equally well (R2 = 0.9965 on the validation set), slightly better than GA and GSA (R2 = 0.9963). The performance metrics for MOD1 in the total dataset were: RMSE = 0.050 and R2 = 0.889; MOD2: RMSE = 0.0080 and R2 = 0.998. WAG outperformed single-phase injection, in some cases with 0.3 units higher RF. The benefits of WAG increased with stronger hysteresis. The LSSVM model could be trained to be less dependent on hysteresis and the non-injected phase during single-phase injection.