Research Article
An Efficient and Fast Model Reduced Kernel KNN for Human Activity Recognition
Algorithm 3
The working process of RK-KNN.
| | Require: | | | Training data matrix ; | | | Testing data matrix ; | | | Number of training data ; | | | Parameter of RK-KNN ; | | | Kernel parameter ; | | | The percentage of selected data for reducing kernel matrix ; | | | Ensure: | | Prediction class . | | | Reduced Kernel Computation Part: | | (1) | Select P percentage samples for each class from the training data as ; | | (2) | Calculate the reduced kernel matrix for training features by equation (9); | | (3) | Calculate the reduced kernel matrix for testing features by equation (10); | | | Loop: | | (4) | fordo | | (5) | fordo | | (6) | Calculate the distance between and by equation (1); | | (7) | end for | | (8) | Sort the distance in the ascending order; | | (9) | Pick the top K vectors from the sorted collection as an index; | | (10) | Set the forecasting the class label based on the most frequent class of processed index. | | (11) | end for | | | return |
|