humancompatible.detect.binarizer.Binarizer module

class humancompatible.detect.binarizer.Binarizer.Bin(feature: Feature, operation: Operation, value: float | tuple[float, float] | int | str | list[int | str] | bool)[source]

Bases: object

evaluate(values: ndarray[int | float | str]) ndarray[bool][source]
negate_self()[source]
class humancompatible.detect.binarizer.Binarizer.Binarizer(data_handler: DataHandler, target_positive_vals: list[int | str] | None = None)[source]

Bases: object

Handles binarizing the dataset

property data_handler
encode(X: ndarray | DataFrame, include_negations=False, include_binary_negations=False) ndarray[bool][source]
encode_y(y: ndarray | Series) ndarray[bool][source]
feature_names(include_negations=False, include_binary_negations=False) list[str][source]
get_bin_encodings(include_negations=False, include_binary_negations=False, return_flat=True)[source]
multi_index_feats(include_negations=False, include_binary_negations=False) MultiIndex[source]
target_name() tuple[str, str][source]
class humancompatible.detect.binarizer.Binarizer.Operation(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

BETWEEN = 'between'
EQ = '='
GE = '>='
GT = '>'
IN = 'in'
LE = '<='
LT = '<'
NE = '!='
NOT_IN = 'not in'
OUTSIDE = 'outside'
classmethod negated(op) Operation[source]
classmethod perform(op: Operation, vals: ndarray[int | float | str], reference: float | tuple[float, float] | int | str | list[int | str] | bool) ndarray[bool][source]