# A Granularity-Based Intelligent Tutoring System for Zooarchaeology
## 2 Materials and Methods
### Methods  
We used 33% of the remains for testing and 67% for training. A pipeline with a standard scaler with a SMOTE (synthetic minority over-sampling technique) or ADASYN (adaptive synthetic) method was used, together with 10-fold cross-validation. The parameter that we want to maximize is f1-score_macro. We have chosen it because F1-score is the harmonic mean of precision and recall, and the macro option calculates metrics for each label, and finds their unweighted mean, and this does not take label imbalance into account. The used algorithms with their parameters have been:  
* Random forest with parameters:
* classifier_n_estimators (number of trees in the forest): [100, 500, 700]
* classifier_max_features (number of features to consider when looking for the best split): ['auto','sqrt', 'log2']
* classifier_class_weight (weights associated with classes; if not given, all classes are supposed to have weight one; the balanced mode uses the values to automatically adjust weights inversely proportional to class frequencies in the input data): ['balanced',None]
* Support vector machine (SVM) with parameters:
* classifier_kernel (specifies the kernel type to be used in the algorithm): ['linear','rbf']
* classifier_gamma (kernel coefficient for 'rbf', 'poly', and'sigmoid'): [\(1\times 10^{-3}\),\(1\times 10^{-4}\)]
* classifier_C (penalty parameter C of the error term): [1, 10, 100]
* Naive bayes. * Neural networks with parameters:
* classifier_solver (the solver for weight optimization. 'lbfgs' is an optimizer in the family of quasi-Newton methods. 'sgd' refers to stochastic gradient descent. 'adam' refers to a stochastic gradient-based optimizer): ['lbfgs','sgd', 'adam']
* classifier_alpha (L2 penalty (regularization term) parameter): [\(1\times 10^{-4}\), \(1\times 10^{-5}\)]
* k-nearest neighbors (KNN) with parameters: \begin{table}
\begin{tabular}{l l} \hline
**Attribute** & **Description** \\ \hline \multirow{3}{*}{Z} & Count: 1232, Mean: 403.047662, Std: 9767.169421, Min: \\  & \(-\)143.8, Q1: \(-\)0.156130, Q2: 166.2, Q3: 192.6, Max: \\  & 342938 \\ \hline \multirow{3}{*}{Manganeso} & Count: 1416, Mean: 1.592514, Std: 0.835553, Min: 1, Q1: \\  & 1, Q2: 1, Q3: 2, Max: 5 \\ \hline \multirow{3}{*}{Concretion} & Count: 1177, Mean: 1.806287, Std: 1.033386, Min: 1, Q1: \\  & 1, Q2: 1, Q3: 2, Max: 5 \\ \hline \multirow{3}{*}{Coarse granularity family: Bovidae, Cervidae, Equidae, Leporidae, unknown} & Bovidae: 420 Cervidae: 516, Equidae: 240, Leporidae: 2164, Unknown: 66, Total: 3406 \\ \hline \multirow{3}{*}{Medium granularity family: Bovidae, Canidae, Cervidae, Equidae, Felidae, Leporidae, Phasianidae, Rhinocerotidae, Suidae, Testudinidae, Unknown: 4, Total: 3406} \\ \cline{2-2}  & Fine granularity family: Anatidae, Bovidae, Bufonidae: 1, Canidae: 8, \\ \cline{2-2}  & Gufonidae, Canidae, Cervidae, Corvidae, Equidae, Felidae: 240, Leportalae: 2164, Phasianidae: 7, \\ \cline{2-2}  & Rhinocerotidae, Suidae, Testudinidae, Ursidae & \\ \hline \end{tabular}
\end{table} 
Table 1: _Cont._classifier_n_neighbors (number of neighbors to use): [3; 5; 7; 9]  
More information about the algorithms can be found in the literature [28]. These algorithms have been implemented using the Python library scikit-learn and the ITS has been implemented using Flask. Regarding the criteria used to distinguish the different taphonomic alterations, zooarchaeological and taphonomic analysis are performed using already established standard methods [29; 30]. Faunal remains are taxonomically and anatomically identified whenever possible, while non-identified specimens with insufficient information were classified into three bone categories (long, flat, or articular) and associated with a weight-size category based on bone density, circumference, and thickness of the cortical surface: large-sized \(>\)300 kg, medium-sized 100-300 kg, small-sized 5-100 kg, and very small-sized \(<\)5 kg [31; 32; 33].