Prediksi Kualitas Susu Menggunakan Metode K-Nearest Neighbors
DOI:
https://doi.org/10.30700/sisfotenika.v14i2.430Keywords:
Milk, Quality, K-NN, Elbow, ClassificationAbstract
Milk is a nutrient-rich source abundant in calcium and lactose, playing a crucial role in addressing nutritional deficiencies. Milk quality is determined by pH levels and pasteurization processes. This research aims to predict milk quality using the K-Nearest Neighbors (K-NN) Method. The analysis is conducted through a series of steps, including data preprocessing involving categorical data encoding, handling missing values, and data cleansing. Subsequently, the optimal K value is selected using the elbow method, with a value of K=3. The data is then divided into training and testing sets to avoid overfitting and validate model performance, and the testing results of using K-NN to predict milk quality are evaluated using three different data splitting schemes: 80-20, 70-30, and 60-40. By utilizing Confusion Matrix to calculate precision, recall, and accuracy, we can assess the proportion of correctly classified positive cases, accurately identified. The best accuracy result is obtained from scheme one at 0,94, with a recall of 0.8, and precision reaching 1. This research provides a significant contribution to understanding, predicting, and monitoring milk quality, encompassing a profound understanding of factors influencing milk quality and the development of advanced predictive models. Overall, this study strengthens the scientific foundation for the dairy industry comprehensively.