Solving the problem of path synthesis for four-bar linkages via either analytical or numerical algorithms may entail issues such as mechanism defects and the need to guess at initial values. Recently, methods for solving such problems using neural network-based schemes show that these issues can be avoided. Despite the success in resolving the issues, there exist areas for further enhancement of the accuracy of the neural network-based scheme. In this work, a learning-based framework including preprocessing, data generation, and model training for the path synthesis of four-bar linkages is presented. The preprocessing starts by regenerating the target path with evenly distributed points along the path, followed by the normalization of the shape and feature extraction. For data generation, unsupervised learning, that is, K-means clustering, is employed to uniformly adjust the distribution of paths of different shapes in the dataset so that robustness of the model can be achieved. As for model training, models based on datasets of different classes of four-bar linkage as well as a classifier to determine the suitable generative model for the target path are constructed. Finally, several examples, including closed and open paths, are illustrated to verify the effectiveness of the framework.