While the transportation sector is one of largest economic growth drivers for many countries, the adverse impacts of transportation on air quality are also well-noted, especially in developing countries. Carbon dioxide (CO2) emissions are one of the direct results of a transportation sector powered by burning fossil-based fuels. Detailed knowledge of CO2 emissions produced by the transportation sectors in various countries is essential for these countries to revise their future energy investments and policies. In this framework, three machine learning algorithms, ordinary least squares regression (OLS), support vector machine (SVM), and gradient boosting regression (GBR), are used to forecast transportation-based CO2 emissions. Both socioeconomic factors and transportation factors are also included as features in the study. We study the top 30 CO2 emissions-producing countries, including the Tier 1 group (the top five countries, accounting for 61% of global CO2 emissions production) and the Tier 2 group (the next 25 countries, accounting for 35% of total CO2 emissions production). We evaluate our model using four-fold cross-validation and report four frequently used statistical metrics (R2, MAE, rRMSE, and MAPE). Of the three machine learning algorithms, the GBR model with features combining socioeconomic and transportation factors (GBR_ALL) has the best performance, with an R2 value of 0.9943, rRMSE of 0.1165, and MAPE of 0.1408. We also find that both transportation features and socioeconomic features are important for transportation-based CO2 emission prediction. Transportation features are more important in modeling for 30 countries, while socioeconomic features (especially GDP and population) are more important when modeling for Tier 1 and Tier 2 countries.