The capital market is an important indicator of a country’s economic development. The ability to predict stock prices accurately can provide many advantages for investors and companies. This study aims to analyze the comparison of the use of different attributes in predicting the closing price of the stock against the resulting accuracy using 11 attributes and 12 attributes with the K-Nearest Neighbor Regression algorithm. This study also aims to predict stock price for PT Adaro Energy Indonesia Tbk using the K-Nearest Neighbor Regression algorithm. The research methodology used in this research is Knowledge Discovery in Databases. The results showed that the use of 11 attributes in predicting the closing price of PT Adaro Energy Indonesia Tbk. gives better results than using 12 attributes. The model evaluation yielded outcomes with 11 attributes, showcasing a Root Mean Squared Error (RMSE) of 35,02. Additionally, the R-squared (R2) value stood at 0.99, accompanied by an Explained Variance Score (EVS) and Mean Absolute Error (MAE) of 0.99 and 24.54, respectively. This shows that selecting the right attribute is very important in predicting the closing price of a stock. Therefore, the selection of the right attributes must be considered in building an accurate predictive model.