2.4 Behaviors classification
We utilized the XGBoost algorithm, a boosting ensemble algorithm that efficiently implements the Gradient boosting decision tree algorithm (Van Soest, 2018), to classify sheep behaviors about energy expenditure and foraging strategies. Specifically, we classified behaviors into grazing (feeding, walking-feeding, walking) and nongrazing behaviors (standing, lying, ruminating-standing, ruminating-lying), as the ODBA was more accurately related to the active status of animals. During the grazing period, actual observed behaviors were conducted for 3-5 days every month, and we eliminated data with multiple behaviors or behavioral changes within 1 minute to ensure the monotonicity of behavioral data (Wang et al., 2020). Ultimately, 2500 individual behavior segments (each segment lasting more than 30 s) were included for analysis.
We acquired 27 features from motion sensors using the ’rabc’ package (Yu and Klaassen, 2021), including mean, variance, standard deviation, max, min, range, and ODBA for each ACC axis separately (denoted with prefixx, y, z in the output data frame), except for ODBA. After filtration, we used 70% of the data combined with actual observed behavior data to develop the behaviors classification model based on the XGBoost algorithm. The remaining 30% was used to validate the classification filter and report the classification accuracy. The results showed more than 90% accuracy for behavior classification (Supplementary Fig. 1a). Similarly, using only ODBA as a classification criterion, we were able to accurately classify feeding behavior (> 0.1 g) and non-feeding behavior (< 0.1 g) (Supplementary Fig. 1b).