The success of machine learning (ML) algorithms depends on the quality of data given to them. If the input data contains insufficient or irrelevant features, the accuracy of machine learning algorithm decreases. Attribute selection has a key role in creation of classification models. Based on the ‘logic behind the inference’ principle in the Nyaya school of thought, this paper proposes a new method — Nyaya Inference Method for Attribute selection and Ranking (NIMAR), for feature selection for the two class classification problem. The Anvayavyatireka Vyapti and hetvabhasa methodologies of the Nyaya school of thought were used for ranking attributes, and removal of irrelevant attributes, respectively. The NIMAR approach showed a remarkable improvement in accuracy compared to the principal component analysis (PCA) method and as good as the Relief feature selection algorithm and the information gain (IG) methods.