Optimization of principal component analysis and k-nearest neighbors in cultivation area classification red onion - Arif Ridho Lubis; Purwa Hasan Putra; Fahdi Saidi Lubis (Universitas Ahmad Dahlan, 2025)
This research aims to increase the effectiveness in classifying shallot cultivation areas through the combined application of principal component analysis (PCA) and k-nearest neighbors (KNN) methods. Shallot is an important agricultural commodity, and identification of optimal areas for its cultivation is essential to support food self-sufficiency. Onion cultivation is generally done in the highlands. One of the areas with shallot cultivation in North Sumatra Province is Berastagi, Karo Regency. This research was conducted by determining the spatial extent of upland land. In the use of data there are 2 types of data that will be used: land suitability dataset and land condition dataset for each region. The PCA method is utilized to simplify the data structure by reducing the number of dimensions and removing insignificant attributes, while KNN was used to classify regions based on their suitability for shallot cultivation. This research produces a classification map that can be used to identify the most optimal areas for shallot cultivation. The test results with the regional spatial dataset using precision, recall and fi-score testing accuracy value 0.92%, and macro avg value 0.94%, weighted avg value 0.93%.