Optimizing the gene transformation factors can be considered as the first and foremost step in successful genetic engineering and genome editing studies. However, it is usually difficult to achieve an optimized gene transformation protocol due to the cost and time-consuming as well as the complexity of this process. Therefore, it is necessary to use a novel computational approach such as machine learning models for analyzing gene transformation data. In the current study, three individual machine learning models including Multi-Layer Perceptron (MLP), Adaptive Neuro-Fuzzy Inference System (ANFIS), and Radial Basis Function (RBF) were developed for forecasting Agrobacterium-mediated gene transformation in chrysanthemum based on eleven input variables including Agrobacterium strain, optical density (OD), co-culture period (CCP), and different antibiotics including kanamycin (K), vancomycin (VA), cefotaxime (CF), hygromycin (H), carbenicillin (CA), geneticin (G), ticarcillin (TI), and paromomycin (P). Consequently, best-obtained results were used in the fusion process by bagging method. Results showed that ensemble model with the highest R 2 (0.83) had superb performance in comparison with all other individual models (MLP:063, RBF:0.69, and ANFIS: 0.74) in the validation set. Also, ensemble model was linked to Fruit fly optimization algorithm (FOA) for optimizing gene transformation, and the results showed that the maximum gene transformation efficiency (37.54%) can be achieved from EHA105 strain with 0.9 OD 600 , for 3.8 days CCP, 46.43 mg/l P, 9.54 mg/l K, 18.62 mg/l H, and 4.79 mg/l G as selection antibiotics and 109.74 μg/ml VA, 287.63 μg/ml CF, 334.07 μg/ml CA and 87.36 μg/ml TI as antibiotics in the selection medium. Moreover, sensitivity analysis demonstrated that input variables have a different degree of importance in gene transformation system in the order of Agrobacterium strain > CCP > K > CF > VA > P > OD > CA > H > TI > G. Generally, the developed hybrid model in this study (ensemble model-FOA) can be employed as an accurate and reliable approach in future genetic engineering and genome editing studies.