Algorithm 2. The Pseudo-code of Activity Recognition Using the Hierarchical Framework |
Inputs: |
(1) a test sample x |
(2) a set of classifiers and feature subsets cls_fs |
Output: |
(1) the activity label of x |
1. set the root node as current node nd; //initialization |
2. obtain the number of children of nd, and note it as |↓(nd)|; |
3. project x over Snd, and use clsnd to get the next-level label PL and corresponding next-level node pnd, in which 1 ≤ pnd ≤ |↓(nd)| and PL corresponds to the maximal probability output of clsnd |
4. if is leaf_node(k) // conditional statement |
(4.1) if TRUE do return PL as the predicted activity label; |
(4.2) if FALSE do set node pnd as current node, and go to step 2; |