Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/skprometheus/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def transform(self, X):

for idx, row in enumerate(categories.T):
for category in row:
if not category:
if category is None:
category = "missing"
MetricRegistry.model_categorical(feature=str(features[idx]), category=str(category)).inc()

Expand Down
1 change: 1 addition & 0 deletions tests/test_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def test_OneHotEncoder():

assert REGISTRY.get_sample_value('skprom_model_categorical_total', {'feature': '2', 'category': '4'}) == 2
assert REGISTRY.get_sample_value('skprom_model_categorical_total', {'feature': '3', 'category': '9'}) == 1
assert REGISTRY.get_sample_value('skprom_model_categorical_total', {'feature': '3', 'category': '0'}) == 1


def test_OneHotEncoder_pandas():
Expand Down