## 4 Proposed Epileptic Seizures Detection Model
### Classification Techniques
#### 4.4.4 K-Nearest Neighbours (KNN)  
KNN is a simple yet effective algorithm that classifies a data point based on how its neighbours are classified. It is a non-parametric method, meaning it makes no explicit assumptions about the form of the function mapping the inputs to the outputs. This makes KNN particularly flexible and easy to implement. The effectiveness of KNN in our context comes from its reliance on the local structure of the data, which can be advantageous in detecting patterns within EEG signals. The simplicity of KNN allows for quick and straightforward implementation, providing a baseline against which more complex models can be compared.  
The selection of these four classification techniques is grounded in their proven track record and complementary strengths. SVM is chosen for its ability to handle high-dimensional data and its robustness against overfitting, making it suitable for complex EEG data. DT and RF are selected for their interpretability and ensemble capabilities, respectively, which enhance model reliability and provide deeper insights into the feature importance. KNN is included for its simplicity and effectiveness in leveraging local data patterns. By presenting a visual depiction of the algorithmic process with flowcharts and pseudocode, particularly for SVM, we offer a clear, step-by-step illustration of how these techniques are implemented in our model. Similar approaches are applied to the other classification techniques, ensuring a comprehensive understanding of their application in seizure detection.  
In summary, our choice of SVM, DT, RF, and KNN is driven by their individual strengths and their collective ability to provide a robust, accurate, and interpretable models for EEG-based epileptic seizure detection. This strategic selection aims to maximize detection accuracy while maintaining model simplicity and interpretability, ultimately contributing to more effective and reliable seizure detection systems. Our approach integrates advanced feature selection techniques and classification algorithms to develop a robust epileptic seizure detection model. Through careful implementation and evaluation, the aim is to enhance the accuracy and efficiency of seizure detection systems, ultimately improving patient outcomes in epilepsy management.  
The classifiers used in this study were implemented using Scikit-learn (1.6.1). SVM was configured with a Radial Basis Function (RBF) kernel and enabled probability estimates. For DT, hyperparameter tuning was conducted using GridSearchCV with 10-fold cross-validation, exploring max_depth values of None, 5, 10, 15, and 20. The RF model was applied using Scikit-learn's default settings, including 100 estimators. The KNN classifier was optimized using GridSearchCV over the hyperparameters n_neighbors = [3, 5, 7, 9] and weights = ['uniform', 'distance'], with the best configuration found to be n_neighbors = 3 and weights = 'distance'. These configurations were selected to provide a balanced assessment of classifier performance. Although a full grid search across all models was not the primary goal of this study, fairness and consistency were ensured in preprocessing and evaluation protocols.