We present an efficient method to construct coarse-grained CG models from models of finer resolution. The method estimates the free energies in a generated sample of the CG conformational space and then fits the entire effective potential surface in the high-dimensional CG conformational space. A jump-in-sample algorithm that uses a random jumping walk in the CG sample is used to iteratively estimate the free energies. We test the method in a tetrahedral molecular fluid where we construct the intermolecular effective potential and evaluate the CG molecular model. Our algorithm for calculating the free energy involves an improvedWang\u2013Landau WL algorithm, which not only works more efficiently than the standard WL algorithm, but also can work in high-dimensional spaces.