Increasing the human capital development index of Indonesia is needed to realize the country’s dream to become a developed country in the world. Quality education is needed for that purpose, and this should start from an early age. School is a formal institution for knowledge transfer, which is very useful in building the quality of an Indonesian’s character. Since 2000, Indonesia has made enormous effort to improve the quality of education, which is measured by increased learning outcome, which is measured by mean national examination score. Indonesia has focused on three major aspects, namely, improving equity and access, enhancing quality and relevance, and strengthening management and accountability. These three aspects are translated into eight standards accreditation score. Education quality is believed to have spatial characteristics that follow the Tobler law. In general, schools close to each other, especially in one administrative area, have the same quality characteristics. The spatial characteristics need to be included in modeling the national examination score. Because of the normality assumption problem, we use a Bayesian spatial autoregressive model (BSAR) to evaluate the effect of the eight standard school qualities on learning outcomes and use k-nearest neighbors (k-NN) optimization in defining the spatial structure dependence. We use junior high schools data in West Java. West Java is one of the largest provinces in Indonesia with the highest number of junior schools. The result shows that the national examination score of the junior high schools in West Java is significantly influenced by the standard of graduate competence, and the standard of assessment. We found that the spatial effect also significant which means the average of the national examination score of the nearest schools influences the national examination of the junior high observed.