detect.data_handler.features.Feature module

class detect.data_handler.features.Feature.Feature(training_vals: ndarray | Series, name: str | None, monotone: Monotonicity = Monotonicity.NONE, modifiable: bool = True)[source]

Bases: ABC

property MAD: ndarray[float64]
abstractmethod allowed_change(pre_val, post_val, encoded: bool) bool[source]

Checks whether value change from pre_val to post_val is allowed by mutability and similar properties

abstractmethod decode(vals: ndarray[float64], denormalize: bool = True, return_series: bool = True, discretize: bool = False) ndarray | Series[source]

Decodes the vals into the original form

abstractmethod encode(vals: ndarray | Series, normalize: bool = True, one_hot: bool = True) ndarray[float64][source]

Encodes the vals

abstractmethod encoding_width(one_hot: bool) int[source]

Returns the width of the encoded values, i.e., the size in teh second dimension (axis 1)

property modifiable
property monotone
property name: str
class detect.data_handler.features.Feature.Monotonicity(value)[source]

Bases: Enum

DECREASING = -1
INCREASING = 1
NONE = 0