Magnetic materials are important basic materials in the information age. Different magnetic ground states are the prerequisite for the wide application of magnetic materials, among which the ferromagnetic ground state is a key requirement for future high-performance magnetic materials. In this paper, machine learning is used to study the classification of ferromagnetic, antiferromagnetic, ferrimagnetic and paramagnetic ground states of inorganic magnetic materials and the prediction of magnetic moments of inorganic ferromagnetic materials. We obtain 98888 inorganic magnetic materials data from the Materials Project database, containing material ids, chemical formulae, CIF files, magnetic ground states and magnetic moments, and extract 582 elemental and structural features for the inorganic magnetic materials by using Matminer. We design a two-step feature selection method. In the first step, RFECV is used to evaluate material features one by one to remove redundant features without degrading the model accuracy. In the second step, we rank the material features to further refine and select the most important material features for the model, and 20 material features are selected for the classification of magnetic ground states and the prediction of magnetic moments, respectively. Among the selected material features, it is found that the electronegativity, the atomic own magnetic moment and the number of unfilled electrons in the atomic peripheral orbitals all make important contributions to the classification of magnetic ground states and the prediction of magnetic moments. We build a magnetic ground state classification model and a magnetic moment prediction model by using the random forest, and quantitatively evaluate the machine learning models by using the 10-fold cross-validation approach, and the results show that the constructed machine learning models has sufficient accuracy and generalization capability. In the test set, the magnetic ground state classification model has an accuracy of 85.23%, a precision of 85.18%, a recall of 85.04%, and an F1 score of 85.24%; the magnetic moment prediction model has a goodness-of-fit of 91.58% and an average absolute error of 0.098 μ<sub>B</sub> per atom. This study provides a new method and choice for high-throughput classification and screening of magnetic ground states of inorganic magnetic materials and predicting the magnetic moment of ferromagnetic materials.