The current research in engine, fuel and lubricant development are aiming towards environmental protection by reducing the harmful emissions. The testing under various conditions becomes mandatory before releasing product to meet the sustainable development goals of United Nations. This experimentation and testing under various operating conditions is time-consuming and tiresome process; it also leads to wastage of manpower, money, precious time and scarce resources. Intelligent techniques like Machine Learning (ML) has proven it's usage in almost all domains, trying to simulate the results as trained. This advantage is used to predict the performance and emission characteristics of a dual fuel engine. In this study, the experimental data are obtained from a single cylinder CI engine by operating under dual fuel mode using biogas and diesel as primary and secondary fuel respectively. The input parameters such as biogas flow rate, methane fraction (MF), torque and intake temperature are considered to predict the output parameters. The output parameters of the study includes performance attributes Brake thermal efficiency, secondary fuel energy ratio, and emissions attributes HC, CO, NOx and smoke. The proposed model uses Random forest Regressor and is trained using 324 distinct experiences recorded through physical experimentation. The model is validated using R2 score which is observed to be 0.997 for the given dataset while trained and tested in the ratio of 85:15. The outputs of the model are used to compute the output data for any new values of input attributes. The optimized values of the input parameters that could give maximum thermal efficiency and minimum emission is found using Lagrangian optimization. The optimized values are 12.48 Nm torque, 8.29 lit/min of biogas flow rate, methane fraction of 72.8%, intake temperature of 68.3 °C.