class_docstr: Shapelet Transform.
  
  Original journal publication:
  @article{hills2014classification,
    title={Classification of time series by shapelet transformation},
    author={Hills, Jon and Lines, Jason and Baranauskas, Edgaras and Mapp,
    James and Bagnall, Anthony},
    journal={Data Mining and Knowledge Discovery},
    volume={28},
    number={4},
    pages={851--881},
    year={2014},
    publisher={Springer}
  }
  
  Parameters
  ----------
  min_shapelet_length                 : int, lower bound on candidate
  shapelet lengths (default = 3)
  max_shapelet_length                 : int, upper bound on candidate
  shapelet lengths (default = inf or series length)
  max_shapelets_to_store_per_class    : int, upper bound on number of
  shapelets to retain from each distinct class (default = 200)
  random_state                        : RandomState, int, or none: to
  control random state objects for deterministic results (default = None)
  verbose                             : int, level of output printed to
  the console (for information only) (default = 0)
  remove_self_similar                 : boolean, remove overlapping
  "self-similar" shapelets from the final transform (default = True)
  
  Attributes
  ----------
  predefined_ig_rejection_level       : float, minimum information gain
  required to keep a shapelet (default = 0.05)
  self.shapelets                      : list of Shapelet objects,
  the stored shapelets after a dataset has been processed
docstr: Early binary IG.
docstr_tok: ["Early","binary","IG","."]
code: def calc_early_binary_ig(
      orderline,
      num_this_class_in_orderline,
      num_other_class_in_orderline,
      num_to_add_this_class,
      num_to_add_other_class,
  ):
      """Early binary IG."""
      # def entropy(ent_class_counts, all_class_count):
  
      initial_ent = ShapeletTransform.binary_entropy(
          num_this_class_in_orderline + num_to_add_this_class,
          num_other_class_in_orderline + num_to_add_other_class,
      )
      bsf_ig = 0
  
      # actual observations in orderline
      count_this_class = 0
      count_other_class = 0
  
      total_all = (
          num_this_class_in_orderline
          + num_other_class_in_orderline
          + num_to_add_this_class
          + num_to_add_other_class
      )
  
      # evaluate each split point
      for split in range(0, len(orderline) - 1):
          next_class = orderline[split][
              1
          ]  # +1 if this class, -1 if other
          if next_class > 0:
              count_this_class += 1
          else:
              count_other_class += 1
  
          # optimistically add this class to left side first and other to
          # right
          left_prop = (split + 1 + num_to_add_this_class) / total_all
          ent_left = ShapeletTransform.binary_entropy(
              count_this_class + num_to_add_this_class,
              count_other_class,
          )
  
          right_prop = 1 - left_prop  # because right side must
          # optimistically contain everything else
          ent_right = ShapeletTransform.binary_entropy(
              num_this_class_in_orderline - count_this_class,
              num_other_class_in_orderline
              - count_other_class
              + num_to_add_other_class,
          )
  
          ig = (
              initial_ent
              - left_prop * ent_left
              - right_prop * ent_right
          )
          bsf_ig = max(ig, bsf_ig)
  
          # now optimistically add this class to right, other to left
          left_prop = (split + 1 + num_to_add_other_class) / total_all
          ent_left = ShapeletTransform.binary_entropy(
              count_this_class,
              count_other_class + num_to_add_other_class,
          )
  
          right_prop = 1 - left_prop  # because right side must
          # optimistically contain everything else
          ent_right = ShapeletTransform.binary_entropy(
              num_this_class_in_orderline
              - count_this_class
              + num_to_add_this_class,
              num_other_class_in_orderline - count_other_class,
          )
          ig = (
              initial_ent
              - left_prop * ent_left
              - right_prop * ent_right
          )
          bsf_ig = max(ig, bsf_ig)
  
      return bsf_ig
  
imports: import heapq
  import time
  import warnings
  from itertools import zip_longest
  from operator import itemgetter
  import numpy
  import pandas
  from joblib import Parallel, delayed
  from sklearn import preprocessing
  from sklearn.utils import check_random_state
  from sklearn.utils.multiclass import class_distribution
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.validation import check_n_jobs
label_desc: Use image node_id 8 for calling the ShapeletTransform obj's underlying member method code with example usage: obj.calc_early_binary_ig(orderline, num_this_class_in_orderline, num_other_class_in_orderline, num_to_add_this_class, num_to_add_other_class) and returns: bsf_ig