Abstract The occurrence of microbes in animal hosts is highly heterogeneous, shaped by interactions among host traits, environmental context, and microbial diversity. Understanding this heterogeneity is particularly critical for endoparasite infections, where some hosts harbor diverse, high-burden assemblages that elevate disease spread and spillover risk. Yet the mechanisms underlying such heterogeneity remain poorly understood in wild systems, especially at the individual-host level. We addressed this challenge by studying protozoan infections in introduced black rats (Rattus rattus) across environmental gradients in Madagascar. Using network-based stochastic block modeling, we identified three infection profiles capturing meaningful variation in protozoan richness and composition, providing a structured framework for understanding heterogeneity. To uncover the predictors of these profiles, we trained machine-learning models incorporating host traits with environmental variables. Our models consistently outperformed no-skill baselines, with host traits contributing 40% more to predictions than environmental factors. Body mass and gut microbiome composition emerged as the strongest host predictors, while rat and other non-native species densities were the most influential environmental predictors. These results show that infection heterogeneity arises from the interplay of intrinsic host traits and extrinsic environmental conditions. Our approach illustrates how combining network analysis with predictive modeling can (1) uncover latent heterogeneity in host–microbe associations, (2) identify the relative contribution of the factors driving this heterogeneity, and (3) predict host infection profiles. Our framework advances microbial ecology by linking host traits, microbial communities, and environmental context, while also informing disease ecology at human–animal interfaces where zoonotic pathogens circulate.
Markfeld et al. (Sun,) studied this question.