This paper proposes a comparison of machine learning (ML) algorithm known as the k-nearest neighbor (KNN) and naïve Bayes (NB) in identifying and diagnosing the harmonic sources in the power system. A single-point measurement is applied in this proposed method, and using the S-transform the measurement signals are analyzed and extracted into voltage and current parameters. The voltage and current features that estimated from time-frequency representation (TFR) of S-transform analysis are used as the input for MLs. Four significant cases of harmonic source location are considered, whereas harmonic voltage (HV) and harmonic current (HC) source type-load are used in the diagnosing process. To identify the best ML, the performance measurement of the proposed method including the accuracy, precision, specificity, sensitivity, and F-measure are calculated. The sufficiency of the proposed methodology is tested and verified on IEEE 4-bust test feeder and each ML algorithm is executed for 10 times due to prevent any overfitting result.