From 1709f406eddda318f39275a4d9f3838bdaa83496 Mon Sep 17 00:00:00 2001
From: Gertjan van den Burg <gertjanvandenburg@gmail.com>
Date: Mon, 25 May 2020 14:27:39 +0100
Subject: Correct calculation of F measure

This commit corrects an error in the calculation of the
F measure and updates the results accordingly. As a precaution,
doctests are added to each of the functions in the metrics.py
file.
---
 .../output/tables/default_f1_combined_full.tex     | 68 +++++++++++-----------
 1 file changed, 34 insertions(+), 34 deletions(-)

(limited to 'analysis/output/tables/default_f1_combined_full.tex')

diff --git a/analysis/output/tables/default_f1_combined_full.tex b/analysis/output/tables/default_f1_combined_full.tex
index 4816db2d..f425bc75 100644
--- a/analysis/output/tables/default_f1_combined_full.tex
+++ b/analysis/output/tables/default_f1_combined_full.tex
@@ -2,47 +2,47 @@
 Dataset & \textsc{amoc} & \textsc{binseg} & \textsc{bocpd} & \textsc{bocpdms} & \textsc{cpnp} & \textsc{ecp} & \textsc{kcpa} & \textsc{pelt} & \textsc{prophet} & \textsc{rbocpdms} & \textsc{rfpop} & \textsc{segneigh} & \textsc{wbs} & \textsc{zero}\\
 \hline
 \verb+bank+ & 0.667 & 0.400 & 0.047 & 0.118 & 0.044 & 0.154 & 0.008 & 0.400 & 0.154 & 0.333 & 0.015 & 0.333 & 0.039 & \textbf{1.000}\\
-\verb+bitcoin+ & 0.367 & 0.278 & \textbf{0.550} & 0.269 & 0.402 & 0.285 & 0.044 & 0.473 & 0.354 & F & 0.186 & 0.473 & 0.279 & 0.450\\
-\verb+brent_spot+ & 0.272 & 0.416 & 0.387 & 0.239 & \textbf{0.555} & 0.418 & 0.048 & 0.402 & 0.173 & 0.321 & 0.375 & 0.366 & 0.354 & 0.315\\
-\verb+businv+ & 0.455 & 0.370 & 0.270 & 0.370 & 0.304 & 0.179 & 0.024 & 0.370 & 0.275 & 0.312 & 0.170 & 0.312 & 0.188 & \textbf{0.588}\\
-\verb+centralia+ & \textbf{0.763} & 0.625 & 0.625 & 0.595 & 0.625 & \textbf{0.763} & 0.200 & 0.625 & \textbf{0.763} & 0.458 & 0.400 & 0.625 & 0.143 & \textbf{0.763}\\
-\verb+children_per_woman+ & 0.472 & 0.472 & \textbf{0.525} & 0.337 & 0.208 & 0.216 & 0.026 & 0.472 & 0.310 & 0.288 & 0.113 & 0.337 & 0.111 & 0.507\\
-\verb+co2_canada+ & 0.544 & 0.691 & 0.619 & 0.265 & 0.578 & \textbf{0.817} & 0.107 & 0.661 & 0.482 & 0.381 & 0.407 & 0.661 & 0.356 & 0.361\\
-\verb+construction+ & 0.516 & 0.547 & 0.481 & 0.410 & 0.359 & 0.430 & 0.019 & 0.547 & 0.324 & 0.480 & 0.115 & 0.547 & 0.248 & \textbf{0.696}\\
-\verb+debt_ireland+ & 0.469 & \textbf{0.760} & \textbf{0.760} & 0.611 & \textbf{0.760} & 0.469 & 0.261 & \textbf{0.760} & 0.469 & 0.530 & 0.462 & \textbf{0.760} & 0.273 & 0.469\\
+\verb+bitcoin+ & 0.367 & 0.426 & \textbf{0.692} & 0.269 & 0.463 & 0.338 & 0.092 & 0.672 & 0.446 & F & 0.284 & 0.672 & 0.464 & 0.450\\
+\verb+brent_spot+ & 0.272 & 0.483 & 0.521 & 0.239 & \textbf{0.607} & 0.478 & 0.104 & 0.465 & 0.249 & 0.321 & 0.490 & 0.431 & 0.516 & 0.315\\
+\verb+businv+ & 0.455 & 0.370 & 0.270 & 0.370 & 0.304 & 0.301 & 0.047 & 0.370 & 0.275 & 0.312 & 0.245 & 0.312 & 0.230 & \textbf{0.588}\\
+\verb+centralia+ & 0.763 & 0.909 & 0.909 & 0.846 & 0.909 & 0.763 & 0.714 & 0.909 & 0.763 & 0.846 & \textbf{1.000} & 0.909 & 0.556 & 0.763\\
+\verb+children_per_woman+ & 0.618 & 0.618 & \textbf{0.637} & 0.337 & 0.326 & 0.349 & 0.068 & 0.618 & 0.310 & 0.288 & 0.246 & 0.337 & 0.271 & 0.507\\
+\verb+co2_canada+ & 0.544 & 0.691 & 0.619 & 0.265 & 0.578 & \textbf{0.817} & 0.169 & 0.661 & 0.482 & 0.381 & 0.569 & 0.661 & 0.520 & 0.361\\
+\verb+construction+ & 0.516 & \textbf{0.709} & 0.634 & 0.410 & 0.602 & 0.574 & 0.038 & \textbf{0.709} & 0.324 & 0.480 & 0.185 & \textbf{0.709} & 0.316 & 0.696\\
+\verb+debt_ireland+ & 0.469 & 0.760 & 0.760 & 0.611 & 0.760 & 0.469 & 0.519 & 0.760 & 0.469 & 0.530 & \textbf{0.824} & 0.760 & 0.538 & 0.469\\
 \verb+gdp_argentina+ & 0.889 & 0.889 & \textbf{0.947} & 0.583 & 0.818 & 0.824 & 0.131 & 0.889 & 0.615 & 0.452 & 0.571 & \textbf{0.947} & 0.148 & 0.824\\
 \verb+gdp_croatia+ & 0.583 & 0.583 & \textbf{1.000} & 0.583 & \textbf{1.000} & 0.824 & 0.160 & 0.583 & 0.824 & 0.452 & 0.400 & 0.583 & 0.167 & 0.824\\
-\verb+gdp_iran+ & 0.492 & 0.492 & 0.424 & 0.492 & 0.330 & \textbf{0.652} & 0.100 & 0.492 & \textbf{0.652} & 0.395 & 0.316 & 0.395 & 0.113 & \textbf{0.652}\\
+\verb+gdp_iran+ & 0.492 & 0.492 & 0.622 & 0.492 & 0.330 & \textbf{0.652} & 0.219 & 0.492 & \textbf{0.652} & 0.395 & 0.609 & 0.395 & 0.246 & \textbf{0.652}\\
 \verb+gdp_japan+ & 0.615 & 0.615 & 0.800 & 0.471 & 0.667 & \textbf{0.889} & 0.068 & 0.615 & \textbf{0.889} & 0.667 & 0.190 & 0.615 & 0.077 & \textbf{0.889}\\
-\verb+global_co2+ & 0.634 & 0.634 & 0.481 & 0.458 & 0.242 & 0.481 & 0.036 & 0.481 & 0.142 & 0.458 & 0.110 & 0.481 & 0.038 & \textbf{0.846}\\
-\verb+homeruns+ & 0.577 & 0.577 & 0.370 & 0.356 & 0.301 & 0.448 & 0.018 & 0.577 & 0.218 & 0.337 & 0.133 & 0.397 & 0.100 & \textbf{0.659}\\
-\verb+iceland_tourism+ & 0.643 & 0.643 & 0.486 & 0.391 & 0.391 & 0.391 & 0.010 & 0.643 & 0.220 & 0.400 & 0.105 & 0.486 & 0.105 & \textbf{0.947}\\
-\verb+jfk_passengers+ & 0.559 & 0.559 & 0.264 & 0.358 & 0.430 & 0.264 & 0.009 & 0.559 & 0.354 & 0.347 & 0.189 & 0.437 & 0.264 & \textbf{0.723}\\
-\verb+lga_passengers+ & 0.422 & 0.305 & 0.399 & 0.297 & 0.264 & 0.392 & 0.021 & 0.305 & 0.366 & 0.348 & 0.262 & 0.264 & 0.245 & \textbf{0.535}\\
+\verb+global_co2+ & \textbf{0.929} & \textbf{0.929} & 0.754 & 0.458 & 0.421 & 0.754 & 0.167 & 0.754 & 0.463 & 0.458 & 0.293 & 0.754 & 0.179 & 0.846\\
+\verb+homeruns+ & \textbf{0.812} & \textbf{0.812} & 0.729 & 0.552 & 0.604 & 0.675 & 0.133 & \textbf{0.812} & 0.723 & 0.508 & 0.661 & 0.397 & 0.593 & 0.659\\
+\verb+iceland_tourism+ & 0.643 & 0.643 & 0.486 & 0.391 & 0.391 & 0.391 & 0.021 & 0.643 & 0.220 & 0.667 & 0.200 & 0.486 & 0.200 & \textbf{0.947}\\
+\verb+jfk_passengers+ & \textbf{0.776} & \textbf{0.776} & 0.437 & 0.559 & 0.574 & 0.437 & 0.026 & \textbf{0.776} & 0.354 & 0.347 & 0.344 & 0.650 & 0.437 & 0.723\\
+\verb+lga_passengers+ & 0.422 & 0.438 & \textbf{0.630} & 0.297 & 0.606 & 0.392 & 0.054 & 0.438 & 0.366 & 0.348 & 0.498 & 0.395 & 0.524 & 0.535\\
 \verb+measles+ & \textbf{0.947} & \textbf{0.947} & 0.069 & 0.124 & 0.118 & 0.069 & 0.004 & 0.124 & 0.391 & 0.117 & 0.030 & 0.327 & 0.039 & \textbf{0.947}\\
 \verb+nile+ & \textbf{1.000} & \textbf{1.000} & \textbf{1.000} & 0.800 & \textbf{1.000} & \textbf{1.000} & 0.040 & \textbf{1.000} & 0.824 & 0.452 & \textbf{1.000} & \textbf{1.000} & \textbf{1.000} & 0.824\\
 \verb+ozone+ & 0.531 & 0.650 & 0.650 & 0.531 & 0.750 & 0.723 & 0.109 & \textbf{1.000} & 0.723 & 0.559 & 0.375 & \textbf{1.000} & 0.113 & 0.723\\
-\verb+quality_control_1+ & \textbf{1.000} & \textbf{1.000} & 0.800 & 0.667 & 0.667 & 0.667 & 0.013 & \textbf{1.000} & 0.500 & 0.667 & 0.667 & \textbf{1.000} & 0.571 & 0.667\\
-\verb+quality_control_2+ & \textbf{1.000} & \textbf{1.000} & \textbf{1.000} & 0.667 & \textbf{1.000} & \textbf{1.000} & 0.014 & \textbf{1.000} & 0.545 & 0.667 & \textbf{1.000} & \textbf{1.000} & \textbf{1.000} & 0.750\\
-\verb+quality_control_3+ & \textbf{1.000} & \textbf{1.000} & \textbf{1.000} & 0.667 & 0.571 & \textbf{1.000} & 0.011 & \textbf{1.000} & 0.667 & 0.333 & 0.286 & \textbf{1.000} & \textbf{1.000} & 0.667\\
-\verb+quality_control_4+ & 0.576 & 0.565 & 0.397 & 0.438 & 0.361 & 0.282 & 0.008 & 0.558 & 0.191 & 0.360 & 0.073 & 0.558 & 0.077 & \textbf{0.780}\\
+\verb+quality_control_1+ & \textbf{1.000} & \textbf{1.000} & 0.800 & 0.667 & 0.667 & 0.667 & 0.025 & \textbf{1.000} & 0.500 & 0.667 & 0.667 & \textbf{1.000} & 0.571 & 0.667\\
+\verb+quality_control_2+ & \textbf{1.000} & \textbf{1.000} & \textbf{1.000} & 0.667 & \textbf{1.000} & \textbf{1.000} & 0.028 & \textbf{1.000} & 0.545 & 0.667 & \textbf{1.000} & \textbf{1.000} & \textbf{1.000} & 0.750\\
+\verb+quality_control_3+ & \textbf{1.000} & \textbf{1.000} & \textbf{1.000} & 0.667 & 0.571 & \textbf{1.000} & 0.022 & \textbf{1.000} & 0.667 & 0.333 & 0.286 & \textbf{1.000} & \textbf{1.000} & 0.667\\
+\verb+quality_control_4+ & 0.810 & \textbf{0.873} & 0.658 & 0.438 & 0.608 & 0.393 & 0.028 & 0.726 & 0.335 & 0.360 & 0.233 & 0.726 & 0.246 & 0.780\\
 \verb+quality_control_5+ & \textbf{1.000} & \textbf{1.000} & \textbf{1.000} & 0.500 & \textbf{1.000} & \textbf{1.000} & 0.006 & \textbf{1.000} & \textbf{1.000} & 0.500 & \textbf{1.000} & \textbf{1.000} & \textbf{1.000} & \textbf{1.000}\\
-\verb+rail_lines+ & \textbf{0.846} & \textbf{0.846} & \textbf{0.846} & 0.349 & 0.778 & 0.537 & 0.105 & \textbf{0.846} & 0.423 & 0.349 & 0.333 & \textbf{0.846} & 0.108 & 0.537\\
-\verb+ratner_stock+ & \textbf{0.776} & 0.683 & 0.526 & 0.333 & 0.126 & 0.201 & 0.013 & 0.650 & 0.280 & 0.559 & 0.092 & 0.683 & 0.115 & 0.571\\
-\verb+robocalls+ & 0.800 & 0.800 & \textbf{0.966} & 0.516 & 0.832 & 0.636 & 0.111 & 0.800 & 0.636 & 0.410 & 0.500 & \textbf{0.966} & 0.113 & 0.636\\
-\verb+scanline_126007+ & 0.524 & 0.259 & 0.220 & 0.379 & 0.233 & 0.300 & 0.009 & 0.188 & \textbf{0.644} & F & 0.097 & 0.297 & 0.078 & \textbf{0.644}\\
-\verb+scanline_42049+ & 0.485 & 0.713 & \textbf{0.962} & 0.735 & 0.608 & 0.580 & 0.063 & 0.744 & 0.202 & 0.390 & 0.262 & 0.684 & 0.276 & 0.276\\
-\verb+seatbelts+ & 0.474 & \textbf{0.683} & 0.583 & 0.383 & 0.509 & 0.321 & 0.041 & \textbf{0.683} & 0.452 & 0.383 & 0.396 & 0.583 & 0.583 & 0.621\\
-\verb+shanghai_license+ & 0.605 & 0.605 & 0.465 & 0.491 & 0.437 & 0.541 & 0.029 & 0.605 & 0.532 & 0.326 & 0.231 & 0.465 & 0.130 & \textbf{0.636}\\
-\verb+uk_coal_employ+ & M & M & M & 0.495 & M & 0.513 & 0.513 & M & \textbf{0.551} & M & M & M & M & 0.513\\
-\verb+unemployment_nl+ & 0.566 & \textbf{0.876} & 0.610 & 0.592 & 0.610 & 0.620 & 0.093 & 0.773 & 0.566 & 0.495 & 0.466 & 0.773 & 0.397 & 0.566\\
-\verb+us_population+ & \textbf{1.000} & 0.667 & 0.216 & 0.471 & 0.216 & 0.174 & 0.005 & 0.471 & 0.159 & 0.242 & 0.889 & 0.320 & 0.077 & 0.889\\
-\verb+usd_isk+ & \textbf{0.785} & 0.657 & 0.609 & 0.678 & 0.409 & 0.518 & 0.024 & 0.657 & 0.489 & 0.282 & 0.167 & 0.657 & 0.188 & 0.489\\
-\verb+well_log+ & 0.279 & 0.534 & 0.796 & 0.769 & 0.822 & 0.818 & 0.052 & 0.555 & 0.149 & 0.578 & \textbf{0.923} & 0.485 & 0.724 & 0.237\\
+\verb+rail_lines+ & 0.846 & 0.846 & 0.846 & 0.349 & \textbf{0.966} & 0.537 & 0.200 & 0.846 & 0.423 & 0.349 & 0.571 & 0.846 & 0.205 & 0.537\\
+\verb+ratner_stock+ & 0.776 & \textbf{0.824} & 0.783 & 0.500 & 0.306 & 0.282 & 0.034 & 0.650 & 0.280 & 0.559 & 0.203 & \textbf{0.824} & 0.250 & 0.571\\
+\verb+robocalls+ & 0.800 & 0.800 & \textbf{0.966} & 0.696 & 0.832 & 0.636 & 0.179 & 0.800 & 0.636 & 0.593 & 0.714 & \textbf{0.966} & 0.182 & 0.636\\
+\verb+scanline_126007+ & 0.710 & 0.739 & 0.820 & 0.767 & \textbf{0.889} & 0.732 & 0.101 & 0.759 & 0.644 & F & 0.649 & 0.732 & 0.616 & 0.644\\
+\verb+scanline_42049+ & 0.485 & 0.713 & \textbf{0.962} & 0.844 & 0.705 & 0.580 & 0.164 & 0.804 & 0.269 & 0.390 & 0.460 & 0.748 & 0.571 & 0.276\\
+\verb+seatbelts+ & 0.474 & \textbf{0.683} & 0.583 & 0.383 & 0.509 & 0.321 & 0.051 & \textbf{0.683} & 0.452 & 0.383 & 0.494 & 0.583 & 0.583 & 0.621\\
+\verb+shanghai_license+ & \textbf{0.868} & \textbf{0.868} & 0.713 & 0.491 & 0.437 & 0.698 & 0.048 & \textbf{0.868} & 0.532 & 0.326 & 0.357 & 0.713 & 0.208 & 0.636\\
+\verb+uk_coal_employ+ & M & M & M & 0.495 & M & 0.513 & 0.513 & M & \textbf{0.639} & M & M & M & M & 0.513\\
+\verb+unemployment_nl+ & 0.566 & \textbf{0.876} & 0.683 & 0.592 & 0.683 & 0.620 & 0.145 & 0.773 & 0.566 & 0.495 & 0.549 & 0.773 & 0.571 & 0.566\\
+\verb+us_population+ & \textbf{1.000} & 0.667 & 0.216 & 0.471 & 0.216 & 0.174 & 0.007 & 0.471 & 0.159 & 0.242 & 0.889 & 0.320 & 0.077 & 0.889\\
+\verb+usd_isk+ & \textbf{0.785} & 0.657 & 0.609 & 0.678 & 0.504 & 0.661 & 0.079 & 0.657 & 0.489 & 0.282 & 0.390 & 0.657 & 0.513 & 0.489\\
+\verb+well_log+ & 0.279 & 0.534 & 0.796 & 0.769 & 0.822 & 0.818 & 0.069 & 0.555 & 0.149 & 0.578 & \textbf{0.923} & 0.485 & 0.724 & 0.237\\
 \hline
-\verb+apple+ &  &  & 0.247 & 0.142 &  & 0.247 & 0.006 &  &  & 0.373 &  &  &  & \textbf{0.594}\\
-\verb+bee_waggle_6+ &  &  & 0.062 & 0.481 &  & 0.124 & 0.003 &  &  & 0.218 &  &  &  & \textbf{0.929}\\
-\verb+occupancy+ &  &  & 0.259 & 0.203 &  & \textbf{0.387} & 0.015 &  &  & 0.163 &  &  &  & 0.341\\
-\verb+run_log+ &  &  & 0.182 & 0.319 &  & 0.195 & 0.014 &  &  & 0.244 &  &  &  & \textbf{0.446}\\
+\verb+apple+ &  &  & 0.513 & 0.318 &  & 0.513 & 0.029 &  &  & 0.373 &  &  &  & \textbf{0.594}\\
+\verb+bee_waggle_6+ &  &  & 0.121 & 0.481 &  & 0.124 & 0.010 &  &  & 0.218 &  &  &  & \textbf{0.929}\\
+\verb+occupancy+ &  &  & \textbf{0.807} & 0.496 &  & 0.750 & 0.107 &  &  & 0.290 &  &  &  & 0.341\\
+\verb+run_log+ &  &  & \textbf{1.000} & 0.420 &  & 0.792 & 0.139 &  &  & 0.543 &  &  &  & 0.446\\
 \hline
 \end{tabular}
-- 
cgit v1.2.3

