src.utils.ctransf.class_reducer
Classes
|
- class src.utils.ctransf.class_reducer.ClassReducer(**kwargs)
- Author:
Alberto M. Esmoris Pena
Class to reduce a given set of input classes into another set of output classes such that each class of the output set corresponds at least 1 (but potentially more) classes of the input set.
More formally, this class represents a map from m input classes to n output classes where \(m \geq n\).
See
ClassTransformer.- Variables:
output_class_names (list of str) – The list of names for the output (transformed) classes. For example [0] is the name of the first output class, i.e., that represented with index 0.
class_groups (list of list of str) – A list which elements are lists of input class names defining the corresponding output class. For example, [1][4] is the fifth input class corresponding to the second output class.
- static extract_ctransf_args(spec)
Extract the arguments to initialize/instantiate a ClassReducer.
- Parameters:
spec – The key-word specification containing the arguments.
- Returns:
The arguments to initialize/instantiate a ClassReducer
- __init__(**kwargs)
Initialize/instantiate a ClassReducer.
- Parameters:
kwargs – The attributes for the ClassReducer
- transform(y, out_prefix=None)
The fundamental transformation logic defining the class reducer.
See
ClassTransformerandclass_transformer.ClassTransformer.transform().