Cancer has been the deadliest of diseases since decades constituting a large number of deaths annually. Lung cancer remains one of the most significant public health issues, accounting for a substantial proportion of cancer-related deaths globally. Despite ongoing efforts to curb the instances of lung cancer, India continues to see a high number of new diagnoses each year, estimated to be 70,000. Early detection of lung cancer can be difficult due to its asymptomatic nature in its initial stages. However, advancements in technology have given rise to computer-aided diagnostic systems to help overcome this challenge. These systems employ a variety of techniques, such as machine learning, deep learning, image analysis, and text mining, to accurately determine the presence of lung cancer. In an effort to create a more advanced model for lung cancer diagnosis, this study proposes the integration of machine learning algorithms, ensemble learning techniques, and particle swarm optimization to assess the outcomes. The results of the study suggest that the ensemble learning approach outperforms traditional machine learning techniques in terms of accuracy.