k-NN Classifier Agent

The AbleKnnClassifierAgent provides a classification function. The k-NN algorithm is used as the classifier model. To use the k-NN agent, the user must specify the data source (and meta data in the form of a *.dfn file). Generating a k-NN classification agent will:

  1. Create Import beans to be used for storing data in the knn model.
  2. Scan through the source data and create the translate filters required to transform and scale the data for input and output to/from the knn bean.
  3. Create the knn bean and initialize it with the default values received from the agent (k, number attributes, number classes, number records), store input data in the knn model, and then switch to test mode. Later on, the k value and the mode can be changed.
  4. Create the data connections for the data to flow through the beans.

At the end of these steps, the classifier agent is configured and the knn model is set to contain the Import corresponding to the input file. Now one of the test or run phases can begin, which means that the knn bean is connected to the other import bean and starts its classification function. The user can choose to test the knn algorithm via Step/Cycle/Run/Halt buttons on the Agent Editor toolbar. Step button will process one test/run example at a time, while Cycle button will make a pass through all the examples in the test/run file. Run button will cycle through the data until the Stop button is pushed. Whenever the end of test/run file is reached, all the corresponding statistics (e.g., accuracy, error, total number of tested examples, number of correctly classified examples) are reset to their default values.