1. Home
  2. K Nearest Neighbours Predictions

K Nearest Neighbours Predictions

This a dialog allows you to use the similarity matrix and settings from the K Nearest Neighbours menu to predict the values for Data to predict for a new set of values for the Data values . The unit numbers of the selected neighbours of an observation can also be stored in a pointer. The variates and/or factors defining the values to be used to form the predictions must be entered into the Values for predictions box. These must match the Data values from the main menu, which are shown in the Training variables to match list Then check the boxes for the information that you want to save, and type the names for the identifiers of the data structures into the corresponding In: fields

Available data

This lists data structures appropriate to the current input field. Double-click a name or use the arrow key to copy it to the current input field or you can type the name

Values for predictions

The values in the new dataset must be entered here. The types and number of structures must match those used to build the similarity matrix. The Training variables to match list displays the variables from the main menu used to create the similarity matrix. This cannot be edited and is just displayed to make the matching of variables easier. You can transfer multiple selections from Available data by holding the Ctrl key on your keyboard while selecting items, then click to move them all across in one action. Items can be removed from this list by selecting them and clicking the button.


The available save options for are as follows:

Predictions Factor or variate Saves the predictions for the observations in the values list. The output type will be the same as the Data to predict structure.
Neighbours Pointer Saves the unit numbers for the neighbours of each observation in a pointer with a variate for each individual.

Note the Neighbours cannot be displayed in a spreadsheet as some units may have differing numbers of neighbours

Display in spreadsheet

Select this to display the results in a new spreadsheet window

Select this to display the results in the Output window Note the Neighbours will be printed only if they have been selected for saving.

Action Icons

Clear Clear all fields and list boxes.
Help Open the Help topic for this dialog.

See also

Updated on February 14, 2023

Was this article helpful?