## 2 Data Analysis Methodology
### Automatic Comparison Using Machine Learning Algorithm Analyzer  
The Python library sklearn ([[https://scikit-learn.org/stable/](https://scikit-learn.org/stable/)]([https://scikit-learn.org/stable/](https://scikit-learn.org/stable/)), accessed on 11 June 2023) was chosen for the automatic comparison as it is easy to use and well documented. It is an open-source library which provides tools for different machine learning classifiers and statistical models, and it was used to train different models with a learning to testing data size ratio of 4:1. The following classification algorithms were used for training:* Logistic regression (LR) classifier
* Decision tree (DT) classifier
* Random forest (RF) classifier
* Gradient boosting (GB) classifier
* K-nearest neighbors (KNN) classifier
* Support vector classifier (SVC)
* Gaussian naive Bayes (GNB) classifier  
The logistic regression classifier is a statistical model based on probabilities. This classifier is utilized to classify data into one of two categories. The algorithm estimates the likelihood of a binary result, e.g., whether an activity type is walking or not, based on a set of input characteristics. The maximum likelihood estimation is used by the algorithm to derive a set of coefficients that can be used to map input features to the logarithm of the odds of the binary outcome.  
The decision tree classifier is a machine learning method used for both regression and classification tasks. It is defined as a supervised learning method and it creates a tree-like model of decisions, emphasizing their possible outcomes.  
The random forest classifier is a machine learning algorithm that utilizes a collection of decision tree classifiers, known as random trees, to classify patterns and data. By training each tree on a random subset of data and employing majority voting, it determines the final class of an input instance. This algorithm effectively handles data with multiple features and delivers precise and reliable results when classifying new data.  
While the random forest classifier builds an ensemble of independent decision trees that vote on the final prediction, the gradient boosting classifier sequentially trains decision trees to correct the errors of previous trees. In this way, it avoids using weak learners in its model and achieves a stronger decision model by adjusting the subsequent models to target the remaining errors or gradients of the loss function from the previous predictions.  
Like the decision tree classifier, the k-nearest neighbors classifier is a type of machine learning algorithm used for both classification and regression tasks. Its accuracy depends on data quality, and it determines the classification of a new data point by finding the \"k\" closest labeled datum in the n-dimension space.  
Another common learning method is the support vector classifier, a linear algorithm that constructs a set of planes with the data separated into multiple classes. It has the advantage of being suitable for large datasets because it can adjust the parameters of the generated spaces.  
The last algorithm we tested was the Gaussian naive Bayes classifier, which is a classification algorithm that assumes that features in the data follow a Gaussian distribution, i.e., that they are independent of each other. It calculates the mean and standard deviation for each feature in each class during training and uses these statistics to build a probability model. It is efficient and works well with high-dimensional data, but it relies on the assumed feature independence.