# An Application to Predict Range of Electric Two-Wheeler Using Machine Learning Techniques
## 4 Results and Discussion  
In order to determine the performances of the six machine learning algorithms, we have used mean absolute error (_MAE_), root mean squared error (_RMSE_), and root relative squared error (_RMSE_) for evaluation. Mean absolute error (_MAE_): When comparing errors in paired observations of the same event, the mean absolute error (_MAE_) is a useful statistic. To calculate _MAE_, multiply the following formula by itself:  
\[MAE=\frac{1}{N}\sum_{i=1}^{N}\lvert y_{i}-\hat{y}_{i}\rvert \tag{11}\]  
Using the same measurement system as the data, we determine the mean absolute error. This accuracy statistic depends on the scale being used; hence, it cannot be used to compare series of different scales [32]. Root mean square error (_RMSE_): The root mean square error (_RMSE_) is a popular statistic for evaluating the accuracy with which a model or estimate matches up with actual data. Due to its dependence on size, _RMSE_ is often employed within a single dataset to compare the accuracy of several models' forecasts rather than as a means of comparing models across datasets [33]. \[RMSE=\sqrt{\frac{1}{N}\sum_{i=1}^{N}(y_{i}-\hat{y}_{i})^{2}} \tag{12}\]  
Root relative squared error (_RRSE_): A simple predictor's accuracy is quantified by its root relative squared error (_RRSE_). The mean of the observed data may be predicted with this easy-to-use metric. Total squared error is normalized by the simple predictor's total squared error, which is why we use the relative squared error. The square root of the relative squared error brings the error down to the same dimension as the expected quantity [34]. RRSE can be defined by the following equation:  
\[RRSE=\sqrt{\frac{\sum_{i=1}^{n}(y^{\prime}-y)^{2}}{\sum_{i=1}^{n}(y-\overline{ y})^{2}}} \tag{13}\]  
where the formula for \(y\) is:  
\[\overline{y}=\frac{1}{n}\sum_{i=1}^{n}y \tag{14}\]  
The performance metrics _MAE_, _RMSE_, and _RRSE_ for the six models are compiled in Table 5. The result from Table 5 depicts that the support vector machine (SVM) algorithm produces the best results for range prediction, whereas additive models (AM) performed better than its base algorithm in all three cases. However, SVM has outperformed all others in this experiment. The high error rate is from the KStar algorithm and, given the fact that we have very limited data, that is understandable. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**ML Model** & **MAE** & **RMSE** & **RRSE** \\
**Name** & **MAE** & **RMSE** & **RRSE** \\ \hline KStar(K*) & 0.26 & 0.4 & 9.65\% \\ Random Forest (RF) & 0.21 & 0.34 & 8.23\% \\ Support Vector Machine (SMOreg) & 0.15 & 0.29 & 7.03\% \\ Additive Regression with K* & 0.26 & 0.39 & 9.43\% \\ Additive Regression with RF & 0.21 & 0.32 & 7.80\% \\
**Additive Regression with SMOreg** & **0.15** & **0.29** & **7.01\%** \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Model performances using training dataset. From Table 5, we can also see that the error rate is not that high, since this is in kilometers. We have observed from the training dataset that the mean distance we have traveled during our experiment trips is around 7.46 km, which makes our result really promising. Moreover, the best performing algorithm has an error of around 150 m on average. Therefore, it is very clear that our approach towards the problem shows much promise. In order to evaluate the model, we have separated a dataset of 40 instances and test our best performing algorithm. Figure 6 illustrates the performance of our best model on the validation dataset by visually representing the chart that compares the actual distance travelled by the electric two-wheeler on the validation set of 40 trips with the predicted distance (in km) generated by the machine learning model. The chart shows two lines, one representing the actual distance and the other depicting the predicted distance, with trip number as the x-axis and distance (in km) travelled as the y-axis.