Corrosion in materials is a significant concern for the industrial and academic fields because corrosion causes enormous losses in various fields such as the economy, environment, society, industry, security, safety, and others. Currently, material damage control using organic compounds has become a popular field of study. Pyridine and quinoline stand out as corrosion inhibitors among a myriad of organic compounds because they are non-toxic, inexpensive, and effective in a variety of corrosive environments. Experimental investigations in developing various candidate potential inhibitor compounds are time and resource-intensive. In this work, we use a quantitative structure-property relationship (QSPR)-based machine learning (ML) approach to investigate support vector machine (SVR), random forest (RF), and k-nearest neighbors (KNN) algorithms as predictive models of inhibition performance. (Inhibition efficiency) corrosion of pyridine-quinoline derivative compounds as corrosion inhibitors on iron. We found that the RF model showed the best predictive ability based on the coefficient of determination (R2) and root mean squared error (RMSE) metrics. Overall, our study provides new insights regarding the ML model in predicting corrosion inhibition on iron surfaces.