The invention discloses a tumor immune subtype classification method and system, the method comprising: acquiring a sample data set including RNA-seq sequencing data and gene expression profile data of multiple tumor tissues; Corresponding microbial abundance data, immune cell ratio data, and immune-related gene expression data in the corresponding tumor tissue; use microbial abundance data, immune cell ratio data, and immune-related gene expression data as classification features to construct training sample data set, and use the SMOTE algorithm to expand the minority class, train the random forest model, and improve the random forest model in the form of weighting: increase the weight of the minority class, make the decision tree classifier focus on the minority class, and improve the minority class. class classification accuracy. The invention can improve the accuracy of tumor immune subtype classification and prediction, and provide a new target for tumor immunotherapy.