In many research disciplines, data are collected as multiple samples from similar populations. For example, the economic industry collects survey data of annual incomes of individuals as multiple samples over years. The semi-parametric density ratio model (DRM) has been shown in many studies as an effective way to have these population distributions connected. Instead of placing parametric assumptions on each of the multiple distributions, DRM postulates that the log ratio of any two densities is linear in some vector-valued basis function. However, in real-world applications, complete knowledge of how to specify a suitable basis function is not possible. In this paper, we develop a methodology to choose a basis function based on data. Specifically, we formulate the problem of choosing a basis function as learning from data an optimal orthonormal basis expansion of the log density ratios. The estimation of the orthonormal basis is achieved through the classical functional principal component analysis. Both theoretical and simulation results show the effectiveness of the proposed approach.