This study introduces feature importance K-nearest neighbors (FIKNN), an innovative adaptation of the K-nearest neighbors (KNN) algorithm tailored for classifying sovereign country credit ratings. The primary objective is to enhance KNN's predictive accuracy by integrating a feature importance mechanism derived from the random forest algorithm, which prioritizes significant features and reduces the impact of less relevant ones, refining the distance computation within KNN. Utilizing a comprehensive dataset of sovereign credit ratings, the performance of FIKNN was assessed against traditional KNN using various feature sets and bootstrap samples. The FIKNN model consistently outperformed the standard KNN by approximately 1% in classification accuracy, attributed to the weighted distance metric adjusting feature influence based on importance. Key findings indicate that FIKNN effectively manages datasets with varying feature relevance and demonstrates a positive correlation between feature diversity and model performance. Future research will explore other distance metrics and refine the feature importance weighting mechanism to broaden FIKNN's applicability in diverse predictive tasks.