Machine learning (ML) is an increasingly popular method to discover the structure and information behind data. In the past years, many efforts have been made on combining ML techniques with quantum mechanics (QM). Most researches in ML QM predict quantum properties from geometries, trained on the data produced by density functional theory (DFT).However, using ML to find density functional approximation will be a more fundamental physics problem.In 2012, the first attempt to apply ML on kinetic energy (KE) functional had achieved chemical accuracy on non-interacting fermions in box, better than any existing approximation.It is essential to understanding the mechanism of the ML model and how it works. In this dissertation, two detailed technical reports will be presented. First, we explore kernel ridge regression (KRR) on a simple function with only one variable. All randomness are removed and the analysis is rigorous. The relation between underfitting, optimal and overfitting regions with hyperparameters are discussed. We discover that ML a density functional shares similar characteristical behaviors with learning a simple function.Then, we give a detailed explanation on ML approximation of KE of non-interacting fermions in a one dimensional box . Several important concepts and steps of ML in DFT are explained and tested.The performance of different kernels and methods of cross-validation are explored. The local principal component analysis (PCA) reconstructs the density manifold and a modified Euler-Lagrange constrained minimization of the ML total energy can give accurate constrained optimal densities.The development of ML algorithms in DFT includes 1d and 3d. In 1d, we model an interacting quantum system trained on data from density matrix renormalization group calculations. A set of atomic centered basis are developed to represent density in 1d by PCA and Hirshfeld partitioning.The Hohenberg-Kohn (HK) universal functional are learned, bypassing the need for a Kohn-Sham scheme. This approach is applied on a wide range of 1d system, from diatomics to thermodynamic limit.In 3d, we compare the candidates of density representation. Instead of solving the ground state density via Euler equation, a ML HK map is developed to predict ground state density from external potential. On the 3d H$_2$ and H$_2$O molecules, the energy prediction from the ML density can be 10 times more accurate than direct prediction from external potential.