Skip to content

Commit

Permalink
Adding tracking of accuracy vs confidence.
Browse files Browse the repository at this point in the history
BUG=107365


Review URL: http://codereview.chromium.org/8895028

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114315 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dominich@chromium.org committed Dec 14, 2011
1 parent 3788ec9 commit 11a8966
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions chrome/browser/autocomplete/network_action_predictor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ NetworkActionPredictor::Action NetworkActionPredictor::RecommendAction(
DCHECK(confidence >= 0.0 && confidence <= 1.0);

if (is_in_db) {
// Multiple enties with the same URL are fine as the confidence may be
// different.
tracked_urls_.push_back(std::make_pair(match.destination_url, confidence));
UMA_HISTOGRAM_COUNTS_100("NetworkActionPredictor.Confidence_" +
prerender::GetOmniboxHistogramSuffix(),
confidence * 100);
Expand Down Expand Up @@ -296,6 +299,19 @@ void NetworkActionPredictor::OnOmniboxOpenedUrl(const AutocompleteLog& log) {
CommitTransaction();

ClearTransitionalMatches();

// Check against tracked urls and log accuracy for the confidence we
// predicted.
for (std::vector<std::pair<GURL, double> >::const_iterator it =
tracked_urls_.begin(); it != tracked_urls_.end();
++it) {
if (opened_url == it->first) {
UMA_HISTOGRAM_COUNTS_100("NetworkActionPredictor.AccurateCount_" +
prerender::GetOmniboxHistogramSuffix(),
it->second * 100);
}
}
tracked_urls_.clear();
}


Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/autocomplete/network_action_predictor.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ class NetworkActionPredictor
// This is cleared after every Omnibox navigation.
std::vector<TransitionalMatch> transitional_matches_;

// This allows us to predict the effect of confidence threshold changes on
// accuracy.
mutable std::vector<std::pair<GURL, double> > tracked_urls_;

DBCacheMap db_cache_;
DBIdCacheMap db_id_cache_;

Expand Down

0 comments on commit 11a8966

Please sign in to comment.