enoppy.utils

enoppy.utils.encoder

class enoppy.utils.encoder.LabelEncoder[source]

Bases: object

Encode categorical features as integer labels.

fit(y)[source]

Fit label encoder to a given set of labels.

yarray-like

Labels to encode.

fit_transform(y)[source]

Fit label encoder and return encoded labels.

Parameters

y (array-like of shape (n_samples,)) – Target values.

Returns

y – Encoded labels.

Return type

array-like of shape (n_samples,)

inverse_transform(y)[source]

Transform integer labels to original labels.

yarray-like

Encoded integer labels.

original_labelsarray-like

Original labels.

transform(y)[source]

Transform labels to encoded integer labels.

yarray-like

Labels to encode.

encoded_labelsarray-like

Encoded integer labels.

enoppy.utils.validator

enoppy.utils.validator.check_bool(name: str, value: bool, bound=(True, False))[source]
enoppy.utils.validator.check_float(name: str, value: int, bound=None)[source]
enoppy.utils.validator.check_int(name: str, value: int, bound=None)[source]
enoppy.utils.validator.check_str(name: str, value: str, bound=None)[source]
enoppy.utils.validator.check_tuple_float(name: str, values: tuple, bounds=None)[source]
enoppy.utils.validator.check_tuple_int(name: str, values: tuple, bounds=None)[source]
enoppy.utils.validator.is_in_bound(value, bound)[source]
enoppy.utils.validator.is_str_in_list(value: str, my_list: list)[source]