Heavy metals (HMs) represent pervasive and highly toxic environmental pollutants, known for their long latency periods and high toxicity levels, which pose significant challenges for their removal and degradation. Therefore, the removal of heavy metals from the environment is crucial to ensure the water safety. Biochar materials, known for their intricate pore structures and abundant oxygen-containing functional groups, are frequently harnessed for their effectiveness in mitigating heavy metal contamination. However, conventional tests for optimizing biochar synthesis and assessing their heavy metal adsorption capabilities can be both costly and tedious. To address this challenge, this paper proposes a data-driven machine learning (ML) approach to identify the optimal biochar preparation and adsorption reaction conditions, with the ultimate goal of maximizing their adsorption capacity. By utilizing a data set comprising 476 instances of heavy metal absorption by biochar, seven classical integrated models and one stacking model were trained to rapidly predict the efficiency of heavy metal adsorption by biochar. These predictions were based on diverse physicochemical properties of biochar and the specific adsorption reaction conditions. The results demonstrate that the stacking model, which integrates multiple algorithms, allows for training with fewer samples to achieve higher prediction accuracy and improved generalization ability.