In conclusion, we used machine learning methods to identify eight diagnostic biomarkers for NSCLC, including ADAMTS8, ABCA8, TPX2, CEP55, ASPA, FHL1, RAMP3, and PYCR1 genes, followed by functional enrichment analysis and immune correlation analysis, and we validated the potential role of the TPX2 gene in vitro. This evidence concerns the gene TPX2 and non-small cell lung carcinoma.