Belle II Software development
SaveClassificationAnalysisRefiner Class Reference
Inheritance diagram for SaveClassificationAnalysisRefiner:
Refiner

Public Member Functions

def __init__ (self, part_name=None, contact=None, estimate_name=None, truth_name=None, cut_direction=None, cut=None, lower_bound=None, upper_bound=None, outlier_z_score=None, allow_discrete=False, unit=None)
 
def refine (self, harvesting_module, crops, tdirectory=None, groupby_part_name=None, groupby_value=None, **kwds)
 

Public Attributes

 part_name
 cached part name for this truth-classification analysis
 
 contact
 cached contact person for this truth-classification analysis
 
 estimate_name
 cached estimates-collection name for this truth-classification analysis
 
 truth_name
 cached truth-values-collection name for this truth-classification analysis
 
 cut
 cached threshold of estimates for this truth-classification analysis
 
 cut_direction
 cached cut direction (> or <) of estimates for this truth-classification analysis
 
 lower_bound
 cached lower bound of estimates for this truth-classification analysis
 
 upper_bound
 cached upper bound of estimates for this truth-classification analysis
 
 outlier_z_score
 cached Z-score (for outlier detection) of estimates for this truth-classification analysis
 
 allow_discrete
 cached discrete-value flag of estimates for this truth-classification analysis
 
 unit
 cached measurement unit of estimates for this truth-classification analysis
 

Static Public Attributes

str default_contact = "{module.contact}"
 default contact person for this truth-classification analysis
 
str default_truth_name = "{part_name}_truth"
 default name for the truth-classification analysis truth-values collection
 
str default_estimate_name = "{part_name}_estimate"
 default name for the truth-classification analysis estimates collection
 

Detailed Description

Refiner for truth-classification analyses

Definition at line 549 of file refiners.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  part_name = None,
  contact = None,
  estimate_name = None,
  truth_name = None,
  cut_direction = None,
  cut = None,
  lower_bound = None,
  upper_bound = None,
  outlier_z_score = None,
  allow_discrete = False,
  unit = None 
)
Constructor for this refiner

Reimplemented from Refiner.

Definition at line 560 of file refiners.py.

571 unit=None):
572 """Constructor for this refiner"""
573
574
575 self.part_name = part_name
576
577 self.contact = contact
578
579 self.estimate_name = estimate_name
580
581 self.truth_name = truth_name
582
583
584 self.cut = cut
585
586 self.cut_direction = cut_direction
587
588
589 self.lower_bound = lower_bound
590
591 self.upper_bound = upper_bound
592
593 self.outlier_z_score = outlier_z_score
594
595 self.allow_discrete = allow_discrete
596
597 self.unit = unit
598

Member Function Documentation

◆ refine()

def refine (   self,
  harvesting_module,
  crops,
  tdirectory = None,
  groupby_part_name = None,
  groupby_value = None,
**  kwds 
)
Process the truth-classification analysis

Reimplemented from Refiner.

Definition at line 599 of file refiners.py.

605 **kwds):
606 """Process the truth-classification analysis"""
607
608 replacement_dict = dict(
609 refiner=self,
610 module=harvesting_module,
611 groupby_key='_' + groupby_part_name + groupby_value if groupby_part_name else "",
612 groupby=groupby_part_name, # deprecated
613 groupby_value=groupby_value, # deprecated
614 )
615
616 contact = self.contact or self.default_contact
617 contact = formatter.format(contact, **replacement_dict)
618
619 if self.truth_name is not None:
620 truth_name = self.truth_name
621 else:
622 truth_name = self.default_truth_name
623
624 truth_name = formatter.format(truth_name, part_name=self.part_name)
625 truths = crops[truth_name]
626
627 if self.estimate_name is not None:
628 estimate_name = self.estimate_name
629 else:
630 estimate_name = self.default_estimate_name
631
632 if isinstance(estimate_name, str):
633 estimate_names = [estimate_name, ]
634 else:
635 estimate_names = estimate_name
636
637 for estimate_name in estimate_names:
638 estimate_name = formatter.format(estimate_name, part_name=self.part_name)
639 estimates = crops[estimate_name]
640
641 classification_analysis = ClassificationAnalysis(quantity_name=estimate_name,
642 contact=contact,
643 cut_direction=self.cut_direction,
644 cut=self.cut,
645 lower_bound=self.lower_bound,
646 upper_bound=self.upper_bound,
647 outlier_z_score=self.outlier_z_score,
648 allow_discrete=self.allow_discrete,
649 unit=self.unit)
650
651 classification_analysis.analyse(estimates, truths)
652
653 if tdirectory:
654 classification_analysis.write(tdirectory)
655
656

Member Data Documentation

◆ allow_discrete

allow_discrete

cached discrete-value flag of estimates for this truth-classification analysis

Definition at line 595 of file refiners.py.

◆ contact

contact

cached contact person for this truth-classification analysis

Definition at line 577 of file refiners.py.

◆ cut

cut

cached threshold of estimates for this truth-classification analysis

Definition at line 584 of file refiners.py.

◆ cut_direction

cut_direction

cached cut direction (> or <) of estimates for this truth-classification analysis

Definition at line 586 of file refiners.py.

◆ default_contact

str default_contact = "{module.contact}"
static

default contact person for this truth-classification analysis

Definition at line 553 of file refiners.py.

◆ default_estimate_name

str default_estimate_name = "{part_name}_estimate"
static

default name for the truth-classification analysis estimates collection

Definition at line 558 of file refiners.py.

◆ default_truth_name

str default_truth_name = "{part_name}_truth"
static

default name for the truth-classification analysis truth-values collection

Definition at line 556 of file refiners.py.

◆ estimate_name

estimate_name

cached estimates-collection name for this truth-classification analysis

Definition at line 579 of file refiners.py.

◆ lower_bound

lower_bound

cached lower bound of estimates for this truth-classification analysis

Definition at line 589 of file refiners.py.

◆ outlier_z_score

outlier_z_score

cached Z-score (for outlier detection) of estimates for this truth-classification analysis

Definition at line 593 of file refiners.py.

◆ part_name

part_name

cached part name for this truth-classification analysis

Definition at line 575 of file refiners.py.

◆ truth_name

truth_name

cached truth-values-collection name for this truth-classification analysis

Definition at line 581 of file refiners.py.

◆ unit

unit

cached measurement unit of estimates for this truth-classification analysis

Definition at line 597 of file refiners.py.

◆ upper_bound

upper_bound

cached upper bound of estimates for this truth-classification analysis

Definition at line 591 of file refiners.py.


The documentation for this class was generated from the following file: