Lung cancer has the highest cancer mortality rate in the UK. Most patients are diagnosed at an advanced stage because common symptoms for lung cancer such as cough, pain, dyspnoea and anorexia are also present in other diseases. This partly attributes towards the low survival rate. Therefore, it is crucial to screen high risk patients for lung cancer at an early stage through computed tomography (CT) scans. As shown in a previous study, for patients who were screened for lung cancer and were identified with stage I lung cancer, the estimated survival rate was 88% compared to only 5% who have stage IV lung cancer. This paper aims to build tree-based machine learning models for predicting lung cancer risk by extracting significant factors associated with lung cancer. The Clinical Practice Research Datalink (CPRD) data was used in this study which are anonymised patient data collected from 945 general practices across the UK. Two tree-based models (decision trees and random forest) are developed and implemented. The performance of the two models is compared with a logistic regression model in terms of accuracy, Area Under the Receiver Operating Characteristic curve (AUROC), sensitivity and specificity, and both achieve better results. However, as for interpretability, it was found that, unlike coefficients in logistic regression, the default feature importance is non-negative in random forests and decision trees. This makes tree-based models less interpretable than logistic regression.