Aggressive behavior is a prevalent and challenging issue in individuals with autism. To investigate whether changes in peripheral physiology recorded by a wearable biosensor and machine learning can be used to predict imminent aggressive behavior before it occurs in inpatient youths with autism. This noninterventional prognostic study used data collected from March 2019 to March 2020 from 4 primary care psychiatric inpatient hospitals. Enrolled participants were 86 psychiatric inpatients with confirmed diagnoses of autism exhibiting operationally defined self-injurious behavior, emotion dysregulation, or aggression toward others; 16 individuals were not included (18.6%) because they would not wear the biosensor (8 individuals) or were discharged before an observation could be made (8 individuals). Data were analyzed from March 2020 through October 2023. Research staff performed live behavioral coding of aggressive behavior while inpatient study participants wore a commercially available biosensor that recorded peripheral physiological signals (cardiovascular activity, electrodermal activity, and motion). Logistic regression, support vector machines, neural networks, and domain adaptation were used to analyze time-series features extracted from biosensor data. Area under the receiver operating characteristic curve (AUROC) values were used to evaluate the performance of population- and person-dependent models. There were 70 study participants (mean [range; SD] age, 11.9 [5-19; 3.5] years; 62 males [88.6%]; 1 Asian [1.4%], 5 Black [7.1%], 1 Native Hawaiian or Other Pacific Islander [1.4%], and 63 White [90.0%]; 5 Hispanic [7.5%] and 62 non-Hispanic [92.5%] among 67 individuals with ethnicity data). Nearly half of the population (32 individuals [45.7%]) was minimally verbal, and 30 individuals (42.8%) had an intellectual disability. Participant length of inpatient hospital stay ranged from 8 to 201 days, and the mean (SD) length was 37.28 (33.95) days. A total of 429 naturalistic observational coding sessions were recorded, totaling 497 hours, wherein 6665 aggressive behaviors were documented, including self-injury (3983 behaviors [59.8%]), emotion dysregulation (2063 behaviors [31.0%]), and aggression toward others (619 behaviors [9.3%]). Logistic regression was the best-performing overall classifier across all experiments; for example, it predicted aggressive behavior 3 minutes before onset with a mean AUROC of 0.80 (95% CI, 0.79-0.81). This study replicated and extended previous findings suggesting that machine learning analyses of preceding changes in peripheral physiology may be used to predict imminent aggressive behaviors before they occur in inpatient youths with autism. Further research will explore clinical implications and the potential for personalized interventions.