New Nd-Fe-B crystal structures can be formed via the elemental substitution of LA-T-X host structures, including lanthanides (LA), transition metals (T), and light elements X = B, C, N, and O. The 5967 samples of ternary LA-T-X materials that are collected are then used as the host structures. For each host crystal structure, a substituted crystal structure is created by substituting all lanthanide sites with Nd, all transition metal sites with Fe, and all light element sites with B. High-throughput first-principles calculations are applied to evaluate the phase stability of the newly created crystal structures, and 20 of them are found to be potentially formable. A datadriven approach based on supervised and unsupervised learning techniques is applied to estimate the stability and analyze the structure-stability relationship of the newly created Nd-Fe-B crystal structures. For predicting the stability for the newly created Nd-Fe-B structures, three supervised learning models, kernel ridge regression, logistic classification, and decision tree model, are learned from the LA-T-X host crystal structures; the models achieve the maximum accuracy and recall scores of 70.4% and 68.7%, respectively. On the other hand, our proposed unsupervised learning model based on the integration of descriptor-relevance analysis and a Gaussian mixture model (GMM) achieves an accuracy and recall score of 72.9% and 82.1%, respectively, which are significantly better than those of the supervised models. While capturing and interpreting the structure-stability relationship of the Nd-Fe-B crystal structures, the unsupervised learning model indicates that the average atomic coordination number and coordination number of the Fe sites are the most important factors in determining the phase stability of the new substituted Nd-Fe-B crystal structures.