The key to the early cultivation of innovative talents is to promote the development of primary and secondary school students’ innovative ability through appropriate education. In order to discover and cultivate the top innovative talents and consolidate the foundation of talent cultivation, based on the survey data of 7552 students, the study focuses on the heterogeneity of internal and external components of the innovative ability, and empirically examines the development mechanism of the students’ innovative ability by machine learning. The study found that, first, the development of students’ innovative ability is a complex process of long-term interaction between various internal and external factors, in which the contribution rate of the internal component of an individual (83.09%) is greater than that of the external environment component (13.44%). Second, the individual’s internal component, such as learning interest and optimism, is the most critical, while the external environment component, teacher support, has the highest contribution rate. Third, in terms of the stage of development of innovativeness, there is temporal fluctuation in the contribution of the factors. Among them, students’ resilience trait and leisure time become more and more critical with the extension of school stages, and teacher support is more important in primary and junior high school. Finally, from the perspective of the prediction model of innovation ability, there is a non-linear relationship between knowledge base, intrinsic motivation, interpersonal support and leisure time and innovation ability. In this regard, we should adhere to the concept of cultivating students’ innovative ability by combining inclusiveness with stratification, improve the cultivation mechanism of endogenous-exogenous dual empowerment, and build the cultivation mode of segmented-through mutual articulation, so that the top innovative talents can continually emerge.