Social networks literature has studied homophily, the tendency to associate with similar others, as a key boundary-making process to explain segregated networks along the lines of identities. Yet, research generally conceptualizes identities as sociodemographic attributes and seldom considers the extent to which people use the performance of identities, or identification, to develop social relationships. Drawing on a formal analysis of culture, this study demonstrates the potential of combining machine learning and exponential random graph models (ERGMs) in capturing this cultural matching process through a case study of gender segregation in friendships. Using survey and sociocentric network data from the National Longitudinal Study of Adolescent to Adult Health, this study outlines the workflow process of training and evaluating machine-learning-based performance of identities. Results show that the method effectively detects homophily in gendered performances. Important limitations and unique strengths of this computational approach are discussed.