## 3 Results and Discussion
### The Hierarchical Classification Structure  
A classification problem including five classes can be solved combining one projection test-based rule node and three classification test-based rule nodes in a tree-structured hierarchical way, as shown in Figure 10. For each of the three classification rule nodes, the number of branches of a node is defined  
Figure 9: Variable importance in projection (VIP) scores from the first PLS-DA model (**a**), the second PLS-DA model (**b**), and the last PLS-DA model (**c**). by the number of classes defined in the classification model. There will be one branch for each class defined, plus the additional \"otherwise\" branch used if none of the other classes is selected. In the test phase, all of the unseen instances (test instances) flowed from left to right and are first passed through the root decision node; the results from this node are used to select one of the branches to the immediate right of the root node. Four rule nodes (blue diamonds) are arranged from left to right; these are the projection rule of the first PCA submodel in SIMCA and three classification rules based on the first, second, and last PLS-DA model, respectively. Specifically, the test condition of the first projection rule is shown here; that is, instances that had a Q residual value larger than the Q limit (shown in Figure 8) would be subject to the right classification rule node. If this test condition was not met, each instance would be output with a string indicating its true class (black rectangle). For each of the three PLS-DA classification rule nodes, there are always three branches representing the output categories: the upper branch represents the positive class, the middle branch includes the negative class, and the lower branch returns the \"otherwise\" string (red rectangle). Clearly, the test instances of the four classes are classified in a top-down approach. At first, all four classes are subject to the second rule (based on the outputs of the first PLS-DA classifier); then, three remaining classes enter the next classifier (based on the outputs of the second PLS-DA classifier), and finally only two classes are subject to the last classifier (based on the outputs of the last PLS-DA classifier). Once the overall hierarchical decision rule has been set up, it can be easily applied to the test set including samples of all five classes, and the prediction results will be a list containing outputs for each row of the test data. In fact, these one-for-all prediction results are just the same as those produced by the four separated models defined above. Overall, the prediction results were very satisfying; all the samples in the MS1 and MS2 classes were correctly predicted as the corresponding classes. The 117 th sample in the MS3 class was incorrectly predicted as belonging to the MS4 class. Additionally, the 48 th and 85 th samples in the MS4 class were incorrectly predicted as belonging to the MS3 class. The 119 th sample in the MS5 class was incorrectly predicted as belonging to the MS3 class. It seems that the PLS-DA model is prone to get confused with those samples whether they are belonging to the MS3 class or the MS4 class. This predictive performance is very similar to the performance that occurs in the training process; for example, the samples in the MS3 and MS4 classes overlap heavily in the PCA scores plot shown in Figure 5b. Furthermore, the misclassification rate of the MS3 and MS4 classes is obviously higher than that of the other classes, as can be seen from the confusion matrices for both training and test in Tables 3 and 4. Taken together, these findings tend to show that the MS3 and MS4 samples are very similar in terms of their absorption properties in the near-infrared region. Reviewing the dominant chemical constituents of the samples in these two classes as shown in Figure 1, it is clear that the two classes are very similar in their content of both oil and protein, which together account for more than 75% of the seed composition.