Developed by
Nishanth Gandhidoss
Raghavendran Shankar
Rahul Gowla
K-Nearest Neighbor
K-Nearest Neighbors is a non-parametric method used for classification. In KNN classification model, the output is a categorical variable which is classified to any of its class labels by considering the majority of its nearest neighbors. The ‘k’ value accounts for how many neighbors should be considered to determine the the class of the output variable. A good number for ‘k’ can be determined by cross-validation of training and test data.
How does KNN work in JAMOVI?
Step 1: Install JAMOVI tools and set the working directory to active Jamovi project.
Step 2: Open JAMOVI on your machine and go to "File" tab and open the data file for which you would like to create the KNN classification model for.
Step 3: Once the data is loaded, under the "Analyse" tab click "MTUClassification" and select "K Nearest Neighbor".
Step 4: The left pane consists of variables/parameters for the model. The output is displayed in the right pane.
Step 5: Move the class variable (categorical) from the data pane to the Dependent variable pane
Step 6: Move the variables which must be included in the model from the data pane to the Independent variable pane.
Step 7: If you want to normalize the independent variable, then "Normalize Variables" checkbox can be ticked to make the variables standardized on a single scale.
Step 8: The data is by default split into 75% train and 25% test set. You can modify the spit % by using "Train/Test split(50% to 90%)" text box.
Step 9: The data can be split as between 50-50 to 90-10 train and test data and can be specified in the "Train/Test split(50% to 90%)" tab.
Step 10: The 'K' value denotes the number of neighbors taken into account for classifying the new data and can be specified in the 'Number of Levels(K)' tab.
Insights and Results(Right pane):