Abstract

Shallots are an important and widely consumed bulb crop in Indonesia, both for medicinal and culinary purposes. However, shallot yield is substantially affected by its supply, often leading to significant price fluctuations that greatly impact consumers and producers, especially farmers. Farmers who cannot accurately predict shallot prices often incur losses when selling to shallot distributors. If this problem is not resolved, it may discourage farmers from cultivating shallots. Therefore, a prediction system is needed to forecast shallot prices in the future, thus helping farmers make the right decisions. This research uses the K-Nearest Neighbors (KNN) algorithm for shallot price prediction. KNN classifies data into specific categories based on the closest distance to a set of k patterns for each category, using the Euclidean distance formula to calculate the distance. The dataset consists of 303 entries with five features: farmer price, seller price, retail price, seed price, and yield. The test results of the Shallot Price Prediction System in North Sumatra Province, Indonesia, using the K-Nearest Neighbors Algorithm, showed the best performance when using 80% training data and 20% testing data, with a value of k=2, resulting in a Mean Absolute Error (MAE) of 25,786 and a Mean Squared Error (MSE) of 72. This system empowers farmers to predict the future price of shallots before selling their crops to distributors.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call