The interaction between psychological stress and immune system may be associated with the cognitive impairment of schizophrenia. To employ machine learning algorithms to examine patterns of stress-immune networks with cognitive impairment in chronic schizophrenia, we selected cortisol, tumor necrosis factor (TNF) - α, interleukin (IL) − 2, IL-6 and IL-8 as biochemical indices reflecting the dysfunctional response to psychological stress and immune system in patients with schizophrenia. Basedon 14 kinds of interactions of above five variables, we were able to classify 37 chronic schizophrenia patients and 35 age and gender-matched healthy controls by using decision tree (DT) (Accuracy = 93.1%, Sensitivity = 97.3%, Specificity = 88.6%), random forest (RF) (Accuracy = 94.4%, Sensitivity = 91.9%, Specificity = 97.1%) and support vector machines (SVM) (Accuracy = 98.6%, Sensitivity = 100.0%, Specificity = 97.1%), which indicating that cortisol × TNF-α × IL-8 was the top risk factor for identifying chronic schizophrenia. Furthermore, we found that cortisol × TNF-α × IL-8 was positively correlated with PANSS cognitive subscore. Multiple stepwise linear regression analysis confirmed that PANSS cognitive subscore was correlated with duration of illness and cortisol × TNF-α × IL-8. The results suggest that the glucocorticoid–immune relationship may have an effect on the cognitive impairment of patients.