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

Side by Side Diff: appengine/findit/crash/predator.py

Issue 2649503002: [Predator] Switch from scorer-based classifier to loglinear classifier. (Closed)
Patch Set: Fix nits. Created 3 years, 10 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 | « appengine/findit/crash/occurrence.py ('k') | appengine/findit/crash/project_classifier.py » ('j') | 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 from crash.culprit import Culprit 5 from crash.culprit import Culprit
6 6
7 7
8 # TODO(http://crbug.com/659346): write coverage tests. 8 # TODO(http://crbug.com/659346): write coverage tests.
9 class Predator(object): # pragma: no cover 9 class Predator(object): # pragma: no cover
10 """The Main entry point into the Predator library.""" 10 """The Main entry point into the Predator library."""
11 11
12 def __init__(self, cl_classifier, component_classifier, project_classifier): 12 def __init__(self, cl_classifier, component_classifier, project_classifier):
13 self.cl_classifier = cl_classifier 13 self.cl_classifier = cl_classifier
14 self.component_classifier = component_classifier 14 self.component_classifier = component_classifier
15 self.project_classifier = project_classifier 15 self.project_classifier = project_classifier
16 16
17 def FindCulprit(self, report): 17 def FindCulprit(self, report):
18 """Given a CrashReport, return a Culprit.""" 18 """Given a CrashReport, return a Culprit."""
19 suspected_cls = self.cl_classifier(report) 19 suspected_cls = self.cl_classifier(report)
20 assert suspected_cls is not None 20 assert suspected_cls is not None
21 21
22 suspected_project = ( 22 suspected_project = (
23 self.project_classifier.ClassifySuspects(suspected_cls) or 23 self.project_classifier.ClassifySuspects(suspected_cls) or
24 self.project_classifier.ClassifyCallStack( 24 self.project_classifier.ClassifyCallStack(
25 report.stacktrace.crash_stack)) 25 report.stacktrace.crash_stack))
26 26
27 suspected_components = ( 27 suspected_components = (
28 self.component_classifier.ClassifySuspects(suspected_cls) or 28 self.component_classifier.ClassifySuspects(suspected_cls) or
29 self.component_classifier.ClassifyCallStack( 29 self.component_classifier.ClassifyCallStack(
30 report.stacktrace.crash_stack)) 30 report.stacktrace.crash_stack))
31 31
32 return Culprit( 32 return Culprit(
33 project = suspected_project, 33 project = suspected_project,
34 components = suspected_components, 34 components = suspected_components,
35 cls = suspected_cls, 35 cls = suspected_cls,
36 regression_range = report.regression_range, 36 regression_range = report.regression_range,
37 algorithm = 'core_algorithm') 37 algorithm = 'core_algorithm')
OLDNEW
« no previous file with comments | « appengine/findit/crash/occurrence.py ('k') | appengine/findit/crash/project_classifier.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698