The leachate discharges generated in sanitary landfills contain many pollutants that are harmful to the environment; treatments are scarce and should be carried out better. The use of coagulation–flocculation processes has been one of the most widely used, but due to the complexity of the characterization of the leachate, the dosing strategy of coagulants and biopolymers needs to be clarified. Therefore, the present study was carried out to determine the doses of coagulants and biopolymers suitable for coagulation–flocculation processes in the treatment of leachates using computational models of machine learning techniques such as artificial neural networks (ANNs); these allow for decreasing the operations of the tests of jars in the laboratory, optimizing resources. Through laboratory experimentation, there are real results of the effectiveness of applying biopolymers in leachate treatments at different concentration levels. The laboratory results were taken as input variables for the algorithms used; after the validation and calibration process, we proceeded to estimate predicted data with the computational model, obtaining predictions of optimal doses for treatment with high statistical adjustment indicators. It is verified that the applied coagulation–flocculation treatments reduce the turbidity values in the leachate and contaminants associated with suspended solids. In this way, the jar tests are optimized so that the operational costs decrease without affecting the results of adequate dosing.