xjjak / LapCal

Building gloves that enable typing on a 34-key keyboard without an actual physical keyboard using IMUs and machine learning.
Other
2 stars 0 forks source link

[FEATURE] State Detection: Define suitable single value metric #28

Closed palisn closed 5 months ago

palisn commented 5 months ago

This is related #7.

A single value metric for more straight-forward model optimization should be introduced. The metric should be a single value composed of multiple weighted desired properties and result in a good estimation of how well the model fits our criteria.

A possible composition might include:

Further considerations concerning the metric include:

palisn commented 5 months ago

As a replacement for the AUC, one could also consider some kind of distance function that would promote confidence, like a normalized Euclidean distance.

palisn commented 5 months ago

As a replacement for the AUC, one could also consider some kind of distance function that would promote confidence, like a normalized Euclidean distance.

For now, we opt for the average ~Manhattan distance~ absolute difference from the actual label converted to a suitable metric from 0 to 1 instead of AUC. This is mostly due to complications with the implementation of the metric, where AUC and a normalized Euclidean distance are not reasonably easy to integrate. We decided to finish the metric with our current implementation and allow for future changes because we wanted to choose it quickly.

palisn commented 5 months ago
The combined metric for now is a weighted average with the following composition Weight (%) Metric
60 fbeta mit $\beta = 2$
20 binary_accuracy
10 precision
10 inv_distance

where, if $\overline{d}$ is the average difference between the prediction and the actual label, inv_distance is defined as $\texttt{inv\_distance} = \text{clip}(1 - 2 \cdot \overline{d}, 0, 1)$.

palisn commented 5 months ago

Commit 42ef6e4db30e485756bef918f6e0615aa341d3b2 resolves this issue.