Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Unified Diff: chrome/browser/autocomplete/network_action_predictor.cc

Issue 7833046: Changing confidence calculation to avoid div by zero (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaking math and unit test expectations Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/autocomplete/network_action_predictor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/network_action_predictor.cc
diff --git a/chrome/browser/autocomplete/network_action_predictor.cc b/chrome/browser/autocomplete/network_action_predictor.cc
index 71a3cd2a12ad6c2272104dbb7f7dc7418708b1af..653cbc3489fc050b15a8e05568d3c6b0ee06967f 100644
--- a/chrome/browser/autocomplete/network_action_predictor.cc
+++ b/chrome/browser/autocomplete/network_action_predictor.cc
@@ -52,9 +52,9 @@ NetworkActionPredictor::Action
const double base_score = 1.0;
- // This constant is ln(1/0.8) so we end up decaying to 80% of the base score
+ // This constant is ln(1/0.65) so we end up decaying to 65% of the base score
// for each week that passes.
- const double kLnDecayPercent = 0.2231435513142097;
+ const double kLnDecayPercent = 0.43078291609245;
base::TimeDelta time_passed = base::Time::Now() - url_row.last_visit();
// Clamp to 0.
@@ -63,13 +63,12 @@ NetworkActionPredictor::Action
base::Time::kMicrosecondsPerWeek);
const double kMaxDecaySpeedDivisor = 5.0;
- const double kNumUsesPerDecaySpeedDivisorIncrement = 1.0;
+ const double kNumUsesPerDecaySpeedDivisorIncrement = 2.0;
const double decay_divisor = std::min(kMaxDecaySpeedDivisor,
(url_row.typed_count() + kNumUsesPerDecaySpeedDivisorIncrement - 1) /
kNumUsesPerDecaySpeedDivisorIncrement);
const double confidence = base_score / exp(decay_exponent / decay_divisor);
-
CHECK(confidence >= 0.0 && confidence <= 1.0);
UMA_HISTOGRAM_COUNTS_100("NetworkActionPredictor.Confidence",
« no previous file with comments | « no previous file | chrome/browser/autocomplete/network_action_predictor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698