# Dwell Time Estimation of Import Containers as an Ordinal Regression Problem
## 3 Materials and Methods
### Dwell Time Estimation as an Ordinal Regression Problem  
To determine the best performed ordinal regression algorithm, we have evaluated 15 algorithms proposed in the literature. These algorithms follow three approaches: a naive approach, an ordinal learning approach, and an approach based on decomposing ordinal problems into binary problems. We employed the implementations in the platform WEKA version 3.8.3. An ordinal regression algorithm with a naive approach consists of converting the values of the ordinal class attribute into numerical values, \"Dwell_time\" in our case. Next, a naive approach applies a regression algorithm \((\delta)\) and uses one of the rounding strategies to map the continuous value calculated by the regressor \((\delta)\) to an ordinal value of the original class (see Equation (4)). \[Dwell\_time(att)= \begin{cases}\left\lfloor\delta(att)\right\rfloor&floor\\ \left\lfloor\delta(att)\right\rceil&round\\ \left\lceil\delta(att)\right\rceil&ceiling\end{cases}  \tag{4}\]  
We have explored five algorithms with this approach:  
* Regression using DecisionTable, and optimizing root mean square error (Reg + DecisionTable + RMSE + Ibk + Round)
* Regression using LibSVM with linear kernel and rounding (Reg + LibSVM + LinearKernel + Round)
* Linear regression with rounding (Reg + LinearRegression + Round)
* Classification via regression using a Linear regression (CvR + LinearRegression)
* Classification via regression using the algorithm M5P (CvR + M5P)  
The second approach is called the Ordinal Learning Method (OLM) [36]. OLM generates symbolic rules using comparison operations from examples in ordinal problems with multiple attributes. The algorithm to generate the symbolic classification rules aims to simulate human behavior when solving ordinal regression problems. The author of OLM tested the performance of the algorithm OLM on four datasets achieving results similar to the decision tree C4 for ordinal regression problems. The third approach is based on decomposing ordinal problems into binary problems with the OrdinalClassClassifier (OCC) [37] method. The algorithm OCC uses supervised classifier for solving problems with ordinal classes. For such a purpose, the algorithm OCC creates a new dataset for each value (\(\parallel\textit{Dwell\_time}\parallel\)) of the ordinal class attribute. New datasets have a new binary class attribute instead of the ordinal class. Such a binary class takes value 1 for the examples for which the ordinal class had a value greater than the index of the current dataset. Then, a supervised classifier is trained with the modified datasets obtaining a model for each dataset. To classify a new example (\(att\)), each model classifies the example and computes the likelihood of belonging to the binary class \((p_{i}(att))\). With these likelihoods, the algorithm OCC computes new values according to the index of the model trained. In the last step, the algorithm OCC selects the class value in the ordinal class attribute corresponding to the index of the max new value computed (see Equation (5)). \[Dwell\_time(att)=\underset{i\in\parallel\textit{Dwell\_time}\parallel}{argmax} \begin{cases}1-p_{i}(att),&i=1\\ p_{i-1}(att)-p_{i}(att),&1<i<\parallel\textit{Dwell\_time}\parallel\\ p_{i}(att),&i=\parallel\textit{Dwell\_time}\parallel\end{cases}  \tag{5}\]We have explored the combination of the method OCC with the classifiers listed below. We have included four kernels (linear, polynomial, RBF, and sigmoidal) for the classifier Support Vector Machine (SVM). * OCC + IBk1
* OCC + Kernel Logistic Regression
* OCC + LibSVM + LinearKernel
* OCC + LibSVM + PolyKernel
* OCC + LibSVM + RBFKernel
* OCC + LibSVM + SigmoidKernel
* OCC + C4.5
* OCC + MLP \(-\) RELU
* OCC + SimpleLogistic  
A conventional metric to evaluate the performance of ordinal regression methods is Mean Absolute Error (MAE) [38; 39; 40; 41; 42; 43; 44].