Skip to content

Quantile export #728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
scrouthtv opened this issue Feb 25, 2025 · 1 comment
Open

Quantile export #728

scrouthtv opened this issue Feb 25, 2025 · 1 comment

Comments

@scrouthtv
Copy link

In order to accurately plot box and whiskers plots using third-party libraries, we have to export the lower and upper (first and third) quantile.

Describe the solution you'd like

diff --git a/evo/core/metrics.py b/evo/core/metrics.py
index 1b6396f..dc10bef 100644
--- a/evo/core/metrics.py
+++ b/evo/core/metrics.py
@@ -59,6 +59,8 @@ class StatisticsType(Enum):
     min = "min"
     max = "max"
     sse = "sse"
+    q1 = "q1"
+    q3 = "q3"
 
 
 @unique
@@ -152,6 +154,10 @@ class PE(Metric):
             return np.min(self.error)
         elif statistics_type == StatisticsType.std:
             return float(np.std(self.error))
+        elif statistics_type == StatisticsType.q1:
+            return np.quantile(self.error, 0.25)
+        elif statistics_type == StatisticsType.q3:
+            return np.quantile(self.error, 0.75)
         else:
             raise MetricsException("unsupported statistics_type")

Describe alternatives you've considered
Using the plots that are saved by evo. Downsides: cannot integrate well with some typesetting systems.

Additional context
New output of evo_results:


APE w.r.t. translation part (m)
(not aligned)


                   rmse      mean    median       std       min      max  \
fasterlio.csv  0.873564  0.727618  0.775811  0.483411  0.004898  1.57153   

                       sse        q1       q3  
fasterlio.csv  1379.711516  0.246562  1.10841  


@MichaelGrupp
Copy link
Owner

Hi,

looks like a useful addition. The diff you posted should be enough to add that, so feel free to make a PR 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants