In this study, we synthesized functional polyketones (FPKs) for removing scaling ions (Ca2+ and Mg2+) from synthetic reverse osmosis concentrate (ROC) and optimized the adsorption processes using experimental and machine learning (ML) techniques, including gene expression programming (GEP) and multilayer perceptron (MLP) modeling. PK30 (a copolymer of ethylene and propylene with carbon monoxide) was reacted with four different amines, including 1,2-diaminopropane (DAP), 1-(2-aminoethyl) piperazine (AEP), butylamine (BA), and 1-(3-aminopropyl) imidazole (API), to produce FPKs. The effects of various factors, such as the amount of FPKs, synthetic ROC concentration, and pH, were investigated to optimize the removal of scaling ions from the synthetic ROC using novel GEP and MLP ML models. The experimental results revealed that Ca2+ and Mg2+ ions might be adsorbed primarily via the chelating mechanism. Increasing FPKs amounts and higher pH levels improved the adsorption process, with even low concentrations of FPKs demonstrating enhanced adsorption. The adsorption of the scaling ions followed the order API > AEP > BA > DAP, with removal percentages of 88.9, 87.3, 83.7, and 83.0 %, respectively. The MLP model outperformed the GEP model in optimizing Ca2+ and Mg2+ adsorption from the synthetic ROC and produced favorable results for all selected amines by determining the input-output relationship for the testing dataset with R2 = 0.806, 0.759, 0.760, and 0.878 for AEP, DAP, API, and BA, respectively. Overall, this study provides a viable solution for the pretreatment of ROC to remove scaling ions, which can improve the performance of zero liquid discharge systems by decreasing energy consumption.