China is one of the world’s major producers and consumers of energy. The investment value of China’s energy industry has attracted the attention of investors at home and abroad. Few studies, however, have specifically investigated investment ratings in China’s traditional energy industry. This study, therefore, uses scientific analysis methods to help investors measure the investment value and returns of China’s energy industry. From the perspectives of market performance and earnings management, we select factors that influence stock value evaluation indicators and undertake an empirical analysis using financial statement data for 2020 from the Wind database. Based on a factor analysis of the main financial indicators (e.g. amplitude, turnover rate, gross profit margin of sales, growth rate of operating revenue), we obtain five main factors: stock market performance, trading heat, profit quality, profit scale, and profit potential. The [Formula: see text]-means algorithm in Python is then used to analyse 56 stocks in China’s energy industry, and we divide their investment ratings into six grades: risk stocks, prudent holding, undetermined class, hold rating, ordinary rating, and buy rating. By identifying the group characteristics of different types of stocks, this study can provide a decision-making basis for investors while also having reference value for research institutions, financial departments, and government departments.