# Similarity-Based Decision Support for Improving Agricultural Practices and Plant Growth
## 3 Results  
To evaluate the effectiveness of the similarity-based decision support system in agricultural contexts, both the K-Nearest Neighbour (KNN) and Approximate Nearest Neighbour using Locality Sensitive Hashing (ANN-LSH) algorithms were applied to a synthetically generated dataset, with sizes ranging from 500 to 100,000 farmer profiles.This setup enables a comparative assessment of how each method identifies and ranks peer profiles with similar agricultural conditions, thereby informing the design of scalable and responsive decision-support tools for farming. The corresponding attribute ranges are detailed in Appendix A. By examining the ordering and selection of similar farmers, the relative strengths and limitations of exact (KNN) versus approximate (ANN-LSH) neighbour search approaches are highlighted. These findings are particularly pertinent for practical scenarios where computational efficiency and response time are of paramount importance. Figures 1 and 2 present the algorithmic of the two algorithms, illustrating the internal mechanisms used to calculate similarity and rank neighbours [43]. While both methods return overlapping groups of similar farmers, the order of the recommendations differs. For instance, the top-ranked recommendation produced by KNN (Figure 3) may occupy a lower position in the ANN-LSH output (Figure 4). Such discrepancies are expected due to the algorithms' differing strategies. For practitioners, the implications of these variations are significant, as recommendation order may influence which practices or peer cases are prioritised when making decisions. To assess scalability, execution time was benchmarked at increasing dataset sizes. For 500 records, KNN required 0.0481 s, whereas ANN-LSH achieved a similar response of 0.0674 s. Initial runs included console-based debug output for neighbour retrieval, later disabled to ensure accurate timing results. A notable performance difference appeared at 8000 farmers, where KNN exhibited a runtime of 6.19 s, while ANN-LSH required only 0.235 s. This divergence continued as the dataset scaled further. When the dataset was expanded to 100,000 farmers, KNN's execution time reached approximately 2043.278 s (over 34 min), while ANN-LSH completed in just 1.004 s. These trends are depicted in Figures 5 and 6, underscoring ANN-LSH's significant computational advantage for large-scale applications. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Hash Functions** & **Bands** & **Use Case** \\ \hline
10 & 5 & Fastest but least accurate \\
20 & 10 & Balanced speed and accuracy \\
50 & 25 & More accuracy, slower \\
100 & 50 & Closest to KNN, very slow \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Hash function and band value interpretation. Figure 1: KNN algorithmic flow. Figure 2: ANN-LSH algorithmic flow. Figure 4: ANN-LSH results. Figure 5: KNN execution time. Figure 3: KNN results. ANN-LSH performance is influenced by the configuration of its parameters, specifically the number of hash functions and bands. As shown in Table 3, lower values yield faster execution but lower accuracy, while higher values improve precision at the cost of increased computational overhead [44; 45]. To further illustrate this trade-off, Table 4 presents execution times for various parameter configurations applied to a dataset of 100,000 farmers. These results confirm that increasing the number of hash functions and bands enhances the approximation quality of ANN-LSH but also leads to slower performance. If configured inappropriately, the algorithm may fail to retrieve sufficiently similar neighbours, reducing the effectiveness of the recommendations delivered to farmers. In summary, both algorithms offer viable approaches for generating peer-based agricultural recommendations. However, ANN-LSH demonstrates a significant advantage in terms of scalability and runtime efficiency, making it a promising candidate for real-time integration in future data-intensive agricultural advisory systems.