Belle II Software  release-06-02-00
fast_equal_frequency_binning Class Reference

Public Member Functions

def __init__ (self, state=None)
 
def fit (self, x, number_of_bins=100)
 
def apply (self, x)
 
def export_state (self)
 

Public Attributes

 state
 State of the class. More...
 

Detailed Description

This class provides a fast implementation of equal frequency binning.
In Equal frequency binning the binning is chosen in a way that every bin has the same number of entries.
An example with a Neural Network can be found in: mva/examples/keras/preprocessing.py

Definition at line 15 of file preprocessing.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  state = None 
)
Init the class.
If you saved a state before and wants to rebuild the class use the state parameter.

Definition at line 22 of file preprocessing.py.

22  def __init__(self, state=None):
23  """
24  Init the class.
25  If you saved a state before and wants to rebuild the class use the state parameter.
26  """
27  if state is None:
28 
29  self.state = {'binning_array': [], 'number_of_bins': 0}
30  else:
31  self.state = state
32 

Member Function Documentation

◆ apply()

def apply (   self,
  x 
)
Bin a dataset

Definition at line 42 of file preprocessing.py.

◆ export_state()

def export_state (   self)
Returns a pickable dictionary to save the state of the class in a mva weightfile

Definition at line 51 of file preprocessing.py.

◆ fit()

def fit (   self,
  x,
  number_of_bins = 100 
)
Do the fitting -> calculate binning boundaries

Definition at line 33 of file preprocessing.py.

Member Data Documentation

◆ state

state

State of the class.

This will be saved

Definition at line 29 of file preprocessing.py.


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