# Comparing Human Activity Recognition Models Based on Complexity and Resource Usage
## 4 Results
### Machine Learning
#### 4.1.1 Hyperparameter Evaluation  
For the Random Forest Classifier, the hyperparameter ranges depicted in Table 4 were evaluated. Figure 4 shows the results of this evaluation. As the evaluation was done by running a grid search over the defined hyperparameters, many different combinations are trained and therefore for each of the hyperparameters, multiple models are trained. The mean performances of the models with a certain value of the hyperparameter are displayed in a subplot for each of them. Intuitively, the most important factors to influence the performance of a Random Forest would be the number of trees it consists of and how deep these individual trees can go. This is also partially in line with our results, where the most performance is gained by finding the best amount of trees (n_estimators) with 81. The other evaluated parameters, the maximum allowed depth, the maximum number of features per tree, the minimum needed samples to split a tree and the criterion function to measure the quality of a split did result only in smaller gains. Across all of the models and parameters, there is a very big spread of performances visible by looking at the error bars on the test performances showing the standard deviation. This could indicate that finding a certain combination of hyperparameters that work well together is very important.  
For the Support Vector Classifier, there were two separate evaluation runs as one of them uses an radial basis function (RBF) kernel while the other uses a linear kernel. With these two having different available hyperparameters, a single evaluation was not possible. Figure 5 shows the results for the SVC with RBF kernel and Figure 6 shows the results for the SVC with linear kernel. For both of them, the determining factor is the regularization parameter \(C\), with the RBF version performing best with a value of 64 and the linear version performing best with a value of 3. For the RBF kernel SVC, another important parameter is gamma, the kernel coefficient, which leads to the best performance with a value of around 0.03.  
The KNN is a somewhat different classifier from the other two in the sense that the predictions always depend on all the trained samples instead of a parameterized model to discriminate classes. Figure 7 shows the evaluated hyperparameters for the KNN. The plots show that the most important hyperparameter, in this case, is the number of neighbouring samples that are used to predict the class of another sample. A value of 9 for n_neighbors performs the best with everything below overfitting too much due to too few neighbours being considered and everything above probably being to coarse to take advantage of local dependencies for a specific class. According to these results, the algorithm used to compute the nearest neighbours, the leaf size of the trees (only applicable, if kd_tree or ball_tree is used as the algorithm) and the weighting of the neighbours (uniform or based on actual distance) do provide no positive gains at all. The one hyperparameter that does still influence the performance is the power parameter \(p\) that influences how the Minkowski metric calculates the distance to the neighbours. With a value of 1, the Minkowski metric is equivalent to the Manhattan distance, while a value of 2 representsthe Euclidean distance. With the Manhattan distance looking to be a slightly better fit in this case.  
Figure 4: Mean performance of Random Forest models for respective evaluated hyperparameters with standard deviation.  
Figure 5: Mean performance of SVC (RBF kernel) models for respective evaluated hyperparameters with standard deviation.