Classical density functional theory (cDFT) offers a powerful statistical-mechanical approach for predicting the structure and thermodynamic properties of inhomogeneous fluids. However, practical applications of cDFT often face two fundamental challenges: 1) no systematic ways for the improvement of density functionals; 2) poor numerical scaling for solving the Euler-Lagrange equation. Functional learning by machine learning (ML) methods is likely to address both challenges. We have demonstrated that active learning with error control (ALEC) are able to build up a reliable emulator for predicting complex functionals with high computational efficiency by emulating cDFT calculations. In this work, we illustrate that active learning methods can also be used to establish machine-learning based density functionals with probabilistic algorithms. The active learning methods are more accurate than conventional ML models with “space-filling” data sampling such as random sampling and Latin hypercube sampling, and show both high computational and data efficiency.