Learning algorithms based on synchronization of oscillators are currently being pursued as an alternative to standard neural-network algorithms for data classification. For such oscillator-based algorithms, while learning can be implemented off-line on a computer, on-chip inference/ testing can be implemented on an array of uniform-mode spin Hall nano-oscillators (SHNOs), leading to a scalable and energy-efficient technology. Here, we propose a modification to an existing oscillator-based off-line learning algorithm for binary classification: unlike in the previous version of the algorithm, here the difference between natural frequencies of the output oscillators is kept constant throughout the learning process. This helps in preservation of the shape of the synchronization region and leads to higher classification accuracy, as we show for binary-classification tasks using two popular data sets: Fisher's Iris and MNIST. Next, in this paper, we show how a synchronization pattern obtained after such training, using our proposed algorithm, can be implemented on an array of dipole-coupled uniform-mode SHNOs for on-chip inference. We model the SHNO system through the macro-spin model, which is computationally much less resource-intensive to simulate compared to the micromagnetic model used previously for this kind of study. We also extend our algorithm to multi-class classification and thereby discuss scaling of our system.