class_docstr: Defines the representation of a scorecard
docstr: @param partitions: A list of instances of class Partition, each specifying the bins for a particular feature.
                     Elements in the list must correspond to distinct features.
  @param bias: The global bias term used during scorecard evaluation
docstr_tok: ["@","param","partitions",":","A","list","of","instances","of","class","Partition",",","each","specifying","the","bins","for","a","particular","feature",".","Elements","in","the","list","must","correspond","to","distinct","features",".","@","param","bias",":","The","global","bias","term","used","during","scorecard","evaluation"]
code: def __init__(self, partitions: List[Partition], bias: Real = 0.0):
      """
      @param partitions: A list of instances of class Partition, each specifying the bins for a particular feature.
                         Elements in the list must correspond to distinct features.
      @param bias: The global bias term used during scorecard evaluation
      """
      if len(partitions) == 0:
          raise ValueError(
              'Need len(partitions) > 0 but found len(partitions) == "{}"'.format(
                  len(partitions)
              )
          )
  
      # Check that all partitions use different features
      seen = []
      for idx, partition in enumerate(partitions):
          try:
              prev_idx = seen.index(partition.feature)
          except ValueError:
              seen.append(partition.feature)
              continue
          raise ValueError(
              "The instances in partitions must correspond to distinct features but the instance"
              'at index "{}" and "{}" use the same feature "{}"'.format(
                  prev_idx, idx, partition.feature
              )
          )
  
      self._partitions = partitions
      self._bias = bias
  
file_path: AIX360/aix360/algorithms/rule_induction/trxf/scorecard/scorecard.py
imports: from numbers import Real
  from typing import List, Tuple, Dict, Any
  from aix360.algorithms.rule_induction.trxf.core import Feature
  from aix360.algorithms.rule_induction.trxf.scorecard import Partition
label_desc: Use image node_id 1 to create a new Scorecard object from inherited base classes: object with example: obj = Scorecard(partitions, bias)