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

Side by Side Diff: components/ntp_snippets/user_classifier.cc

Issue 2845483003: [User classifier] Adapt the defaults to planned M58 rollout (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/ntp_snippets/user_classifier.h" 5 #include "components/ntp_snippets/user_classifier.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cfloat> 8 #include <cfloat>
9 #include <string> 9 #include <string>
10 10
(...skipping 23 matching lines...) Expand all
34 const double kMaxHours = 7 * 24; 34 const double kMaxHours = 7 * 24;
35 const char kMaxHoursParam[] = "user_classifier_max_hours"; 35 const char kMaxHoursParam[] = "user_classifier_max_hours";
36 36
37 // Ignore events within |kMinHours| hours since the last event (|kMinHours| is 37 // Ignore events within |kMinHours| hours since the last event (|kMinHours| is
38 // the length of the browsing session where subsequent events of the same type 38 // the length of the browsing session where subsequent events of the same type
39 // do not count again). 39 // do not count again).
40 const double kMinHours = 0.5; 40 const double kMinHours = 0.5;
41 const char kMinHoursParam[] = "user_classifier_min_hours"; 41 const char kMinHoursParam[] = "user_classifier_min_hours";
42 42
43 // Classification constants. 43 // Classification constants.
44 const double kActiveConsumerClicksAtLeastOncePerHours = 72; 44 const double kActiveConsumerClicksAtLeastOncePerHours = 96;
45 const char kActiveConsumerClicksAtLeastOncePerHoursParam[] = 45 const char kActiveConsumerClicksAtLeastOncePerHoursParam[] =
46 "user_classifier_active_consumer_clicks_at_least_once_per_hours"; 46 "user_classifier_active_consumer_clicks_at_least_once_per_hours";
47 47
48 const double kRareUserOpensNTPAtMostOncePerHours = 96; 48 const double kRareUserOpensNTPAtMostOncePerHours = 66;
vitaliii 2017/04/26 14:25:50 Why 66? It does not look "even". Probably add a co
jkrcal 2017/05/02 10:43:54 Done.
49 const char kRareUserOpensNTPAtMostOncePerHoursParam[] = 49 const char kRareUserOpensNTPAtMostOncePerHoursParam[] =
50 "user_classifier_rare_user_opens_ntp_at_most_once_per_hours"; 50 "user_classifier_rare_user_opens_ntp_at_most_once_per_hours";
51 51
52 // Histograms for logging the estimated average hours to next event. 52 // Histograms for logging the estimated average hours to next event.
53 const char kHistogramAverageHoursToOpenNTP[] = 53 const char kHistogramAverageHoursToOpenNTP[] =
54 "NewTabPage.UserClassifier.AverageHoursToOpenNTP"; 54 "NewTabPage.UserClassifier.AverageHoursToOpenNTP";
55 const char kHistogramAverageHoursToShowSuggestions[] = 55 const char kHistogramAverageHoursToShowSuggestions[] =
56 "NewTabPage.UserClassifier.AverageHoursToShowSuggestions"; 56 "NewTabPage.UserClassifier.AverageHoursToShowSuggestions";
57 const char kHistogramAverageHoursToUseSuggestions[] = 57 const char kHistogramAverageHoursToUseSuggestions[] =
58 "NewTabPage.UserClassifier.AverageHoursToUseSuggestions"; 58 "NewTabPage.UserClassifier.AverageHoursToUseSuggestions";
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 375
376 void UserClassifier::SetMetricValue(Metric metric, double metric_value) { 376 void UserClassifier::SetMetricValue(Metric metric, double metric_value) {
377 pref_service_->SetDouble(kMetricKeys[static_cast<int>(metric)], metric_value); 377 pref_service_->SetDouble(kMetricKeys[static_cast<int>(metric)], metric_value);
378 } 378 }
379 379
380 void UserClassifier::ClearMetricValue(Metric metric) { 380 void UserClassifier::ClearMetricValue(Metric metric) {
381 pref_service_->ClearPref(kMetricKeys[static_cast<int>(metric)]); 381 pref_service_->ClearPref(kMetricKeys[static_cast<int>(metric)]);
382 } 382 }
383 383
384 } // namespace ntp_snippets 384 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698