In the construction of the machine learning model of dipoles, we employ the KRR approach and the Coulomb matrix as the molecular descriptor to represent the molecular geometry. We define a relative Cartesian coordinate system (as opposed to the actual Cartesian coordinates of the molecule) in the machine learning process. Similar to the Coulomb matrix, dipoles can also be invariant to the translational and rotational motion of molecules based on the relative Cartesian coordinate system. The relative Cartesian coordinate system defined in this work provides the possibility to fit a molecular property that is dependent on the orientation of the molecular geometry. In the training process, we use the hierarchical agglomerative clustering algorithm, which largely reduces the training dataset as well as the testing error.