CFH and FHL2 were identified as key genes with diagnostic accuracy for IPF by three machine learning algorithms. Here, CFH is linked to idiopathic pulmonary fibrosis.