Motor fault diagnosis is an important task in the operational monitoring of electrical machines in manufacturing. This study proposes an effective bearing fault diagnosis model for electrical machinery based on machine learning techniques. The proposed model is a combination of three processes: feature extraction of signals collected from the motor based on multi-resolution analysis, fast Fourier transform, and envelope analysis. Next, redundant or irrelevant features are removed using the feature selection technique. A binary salps swarm algorithm combined with an extended repository is the proposed method to remove unnecessary features. As a result, an optimal feature subset is obtained to improve the performance of the classification model. Finally, two classifiers, k-nearest neighbor and support vector machine, are used to classify the fault of the electric motor. There are four input datasets used to evaluate the model performance, and UCI is the benchmark dataset to verify the effectiveness of the proposed feature selection technique. The remaining three datasets include the bearing dataset collected from experiments, with an average classification accuracy of 99.9%, as well as Case Western Reserve University (CWRU) and Machinery Failure Prevention Technology (MFPT), which are public datasets with average classification accuracies of 99.6% and 98.98%, respectively. The experimental results show that this method is more effective in diagnosing bearing faults than other traditional methods and prove its robustness.