Through the lens of science capital, this research aims to detect the key factors and their main effects in identifying students with science‐related career expectations. A machine learning approach (i.e., random forest) was employed to analyze a dataset of 519,334 15‐year‐old students from the Programme for International Student Assessment (PISA) 2015. The global analysis identified 25 key factors out of 88 contextual features: (1) for “how you think,” making students feel science is relevant, enjoyable, and interesting is relatively more crucial than being ambitious and confident; (2) for “what science you know,” students' science and math literacy, epistemological beliefs, and awareness of environmental matters were the key factors; (3) for “who you know,” parents valuing science, expecting their children to enter science, and providing emotional support were as similar as or even more important than their economic, social, and cultural status (ESCS)‐related constructs, while teachers fairness ranked the top among all teaching‐related features; and (4) for “what you do,” appropriate science learning time, engagement in science activities, and ICT use for schoolwork were key factors. These findings indicate a relatively optimistic situation, as the most key capitals were malleable for educators. Accumulated local effect plots further discriminated how these key capitals related to students' career expectations in four distinct ways: “increasing,” “S‐shaped,” “inverted‐U‐shaped,” and “decreasing,” shedding light on how we could optimize key resources to enhance aspirations. The comparison between global and Hong Kong analyses suggests the key factors identified by the global model were generally effective but not necessarily essential for a specific region. The cross‐cultural generalizability or prevalence of capitals might vary by their forms.