Deriving the basic reproduction number (R0) in compartmental infectious disease models often involves finding a closed-form formula using the next generation matrix, a process that can be complex and time-consuming. In this paper, I present a novel alternative method for estimating R0 that leverages numerical simulations and machine learning, specifically logistic regression. This approach not only simplifies the calculation of R0 but also integrates parameter sensitivity analysis into a unified framework, enhancing the efficiency of model analysis. The method's simplicity is demonstrated through accessible R code, making it a versatile template for applying machine learning techniques to R0 estimation across various infectious disease models.