summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2011-04-13 14:27:27 +0200
committerjasplin <qt-info@nokia.com>2011-04-13 14:27:27 +0200
commit66957dfb8b629c2bfecc83840aa2d0286de55f05 (patch)
tree046cf71ed64d755f6ffb6b074870a399558dba83
parenta42002e623bed3b4ef63ea92c56333237d25f33b (diff)
Adjust formula for last change stability score.
The formulas for LCSS and LCSS1 are now back to the original: LCSS1 = LCMS * LCGSS * LCLSS * LCDS1 LCSS = LCSS1 * LCDS2 A simple product turned out to be the most robust way to avoid assigning significant scores to certain outlier cases after all. This patch also redefines the global separation score slightly to make it more robust (the values before the last change are now compared against all values at or after the last change, rather than just the last change value itself). Finally, the default maximum durability score is adjusted from 30 to 10 (i.e. 10 seems to be sufficient to establish stability).
-rwxr-xr-xscripts/computerankings.py8
-rw-r--r--scripts/misc.py36
-rw-r--r--web/analysis/global.js2
-rw-r--r--web/analysis/main.js2
-rw-r--r--web/analysis/tsbmbody.js6
-rw-r--r--web/analysis/tsstats.js4
6 files changed, 29 insertions, 29 deletions
diff --git a/scripts/computerankings.py b/scripts/computerankings.py
index 0f1bf0f..8ad1fd3 100755
--- a/scripts/computerankings.py
+++ b/scripts/computerankings.py
@@ -61,7 +61,7 @@ def changeMagnitudeScore(change):
# ### 2 B DOCUMENTED!
# NOTE: This function is currently duplicated elsewhere in JavaScript!
def qualityScore(lsd, ni, nz, nc, mdrse):
- max_bad_snapshots = 30 # experimental; maybe use max durability score?
+ max_bad_snapshots = 10 # experimental; maybe use max durability score?
max_sample_size = 5;
max_LSD = max_bad_snapshots;
max_NI = max_bad_snapshots * max_sample_size;
@@ -153,8 +153,8 @@ def getAllRankingStats(bmstats_list):
lcds1 = stats["lc_dur1_score"]
lcds2 = stats["lc_dur2_score"]
lcms = changeMagnitudeScore(lc)
- lcss1 = (lcms + lcgss + lclss + lcds1) / 4.0
- lcss = (lcms + lcgss + lclss + (lcds1 * lcds2)) / 4.0
+ lcss1 = lcms * lcgss * lclss * lcds1
+ lcss = lcss1 * lcds2
if lc < 1.0:
lcssr = lcss
lcss1r = lcss1
@@ -238,7 +238,7 @@ def updateRankings(
# For simplicity we hardcode the tolerances for now:
difftol = 1.1
durtolmin = 3
- durtolmax = 30
+ durtolmax = 10
# Determine the target snapshot range:
# (The range should end at the snapshot given on the command-line and begin
diff --git a/scripts/misc.py b/scripts/misc.py
index e5663c3..b3a2274 100644
--- a/scripts/misc.py
+++ b/scripts/misc.py
@@ -379,17 +379,6 @@ def metricAdjustedRatio(base_val, val, lower_is_better):
# change i + 1.
# 3: Metric-adjusted change ratio, i.e. the factor by which the change
# value improves over the base value.
-
-# 4: Global separation score. This measures how well all values before
-# the change index are separated from the change value with respect to
-# the base value.
-# The score ranges from 0 (poor separation) to 1 (good separation).
-# If all target values lie on the far side of the base value
-# (as seen from the change value), the score is 1.
-# If at least one target value lies on the far side of the change value
-# (as seen from the base value), the score is 0.
-# Otherwise, the score depends on the value that is furthest away
-# from the base value in the direction of the change value.
#
# DEFINITIONS:
# - Segment S1: The values in range [base index, change index>.
@@ -397,20 +386,31 @@ def metricAdjustedRatio(base_val, val, lower_is_better):
# (Or the end of the time series if there is no next change
# index)
#
+# 4: Global separation score. This measures how well all values before
+# the change index are separated from the values in segment S2 with
+# respect to the base value.
+# The score ranges from 0 (poor separation) to 1 (good separation).
+# If all target values lie on the far side of the base value
+# (as seen from the nearest value in segment S2), the score is 1.
+# If at least one target value lies on the far side of the nearest value
+# in segment S2 (as seen from the base value), the score is 0.
+# Otherwise, the score depends on the value that is furthest away
+# from the base value in the direction of the nearest value in segment S2.
+#
# 5: Local separation score. A variant of global separation score that
# measures how well the values in segment S1 and segment S2 are separated
# from each other.
# The score ranges from 0 (low separation) to 1 (high separation).
#
-# 6: Duration score for S1. This measures the number of values in S1
+# 6: Durability score for S1. This measures the number of values in S1
# with respect to durtolmin and durtolmax.
-# The score ranges from 0 (few values; low duration) to
-# 1 (many values; high duration).
+# The score ranges from 0 (few values; low durability) to
+# 1 (many values; high durability).
# The score is 0 if S1 contains fewer than durtolmin values.
# The score is 1 if S1 contains at least durtolmax values.
# Otherwise, the score depends on the number of values in S1.
#
-# 7: Duration score for S2. (Ditto)
+# 7: Durability score for S2. (Ditto)
#
def getChanges(time_series, lower_is_better, difftol, durtolmin, durtolmax):
if len(time_series) == 0:
@@ -518,15 +518,15 @@ def getChanges(time_series, lower_is_better, difftol, durtolmin, durtolmax):
lmin2 = s2[4]
lmax2 = s2[5]
if change_val < base_val:
- gsep_score = (gmin - change_val) / float(base_val - change_val)
+ gsep_score = (gmin - lmax2) / float(base_val - change_val)
lsep_score = (lmin1 - lmax2) / float(base_val - change_val)
else:
- gsep_score = (change_val - gmax) / float(change_val - base_val)
+ gsep_score = (lmin2 - gmax) / float(change_val - base_val)
lsep_score = (lmin2 - lmax1) / float(change_val - base_val)
gsep_score = min(max(gsep_score, 0), 1)
lsep_score = min(max(lsep_score, 0), 1)
- # Compute duration scores:
+ # Compute durability scores:
pvals1 = s1[6]
pvals2 = s2[6]
assert durtolmin > 0
diff --git a/web/analysis/global.js b/web/analysis/global.js
index 1a4148d..f8f1cc1 100644
--- a/web/analysis/global.js
+++ b/web/analysis/global.js
@@ -69,7 +69,7 @@ function changeMagnitudeScore(change) {
// ### 2 B DOCUMENTED!
// NOTE: This function is currently duplicated elsewhere in Python!
function qualityScore(lsd, ni, nz, nc, mdrse) {
- var maxBadSnapshots = 30; // experimental; maybe use max durability score?
+ var maxBadSnapshots = 10; // experimental; maybe use max durability score?
var maxSampleSize = 5;
var maxLSD = maxBadSnapshots;
var maxNI = maxBadSnapshots * maxSampleSize;
diff --git a/web/analysis/main.js b/web/analysis/main.js
index 30b5401..735c5d8 100644
--- a/web/analysis/main.js
+++ b/web/analysis/main.js
@@ -565,7 +565,7 @@ $(document).ready(function() {
$("#max_rank_size option[value='10']").attr("selected", true);
$("#diff_tol option[value='1.1']").attr("selected", true);
$("#dur_tol_min option[value='3']").attr("selected", true);
- $("#dur_tol_max option[value='50']").attr("selected", true);
+ $("#dur_tol_max option[value='10']").attr("selected", true);
fetchContexts();
});
diff --git a/web/analysis/tsbmbody.js b/web/analysis/tsbmbody.js
index 2c14659..8706208 100644
--- a/web/analysis/tsbmbody.js
+++ b/web/analysis/tsbmbody.js
@@ -110,7 +110,7 @@ function tooltipText_lcms() {
function tooltipText_lcss() {
return "Stability score for the last significant change:<br /><br />" +
"&nbsp;&nbsp;&nbsp;&nbsp;" +
- "(LCMS + LCGSS + LCLSS + (LCDS1 * LCDS2)) / 4<br /><br />" +
+ "LCMS * LCGSS * LCLSS * LCDS1 * LCDS2<br /><br />" +
"The higher this score, the higher the likelihood that the last " +
"significant change is or will become permanent.";
}
@@ -119,10 +119,10 @@ function tooltipText_lcss1() {
return "Stability score for the last significant change that does not " +
"consider the history after the latter:<br /><br />" +
"&nbsp;&nbsp;&nbsp;&nbsp;" +
- "(LCMS + LCGSS + LCLSS + LCDS1) / 4<br /><br />" +
+ "LCMS * LCGSS * LCLSS * LCDS1<br /><br />" +
"The higher this score, the higher the likelihood that the last " +
"signicifant change is or will become permanent, but since LCDS2 is " +
- "omitted from the sum, a high LCSS1 is more likely to be caused " +
+ "omitted from the product, a high LCSS1 is more likely to be caused " +
"by an outlier than a high LCSS!";
}
diff --git a/web/analysis/tsstats.js b/web/analysis/tsstats.js
index bba859f..93e58ab 100644
--- a/web/analysis/tsstats.js
+++ b/web/analysis/tsstats.js
@@ -124,10 +124,10 @@ function populatePbmTable(tableSel, data) {
lcds1 = stats.lc_dur1_score;
lcds2 = stats.lc_dur2_score;
- lcss = (lcms + lcgss + lclss + (lcds1 * lcds2)) / 4.0;
+ lcss = lcms * lcgss * lclss * lcds1 * lcds2;
rbdy += "<td>" + lcss + "</td>";
- lcss1 = (lcms + lcgss + lclss + lcds1) / 4.0;
+ lcss1 = lcms * lcgss * lclss * lcds1;
rbdy += "<td>" + lcss1 + "</td>";
rbdy += "<td>" + lcgss.toFixed(4) + "</td>";