From 281623cfca6f6639948cd08327421d36c8cf861f Mon Sep 17 00:00:00 2001 From: Isaac Sears Date: Wed, 4 Nov 2020 11:21:35 -0600 Subject: [PATCH] Add descriptive msg for TabNetClassifier multilabel classification Fix linting error Use IndexError and clarify message Fix typo --- pytorch_tabnet/multiclass_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pytorch_tabnet/multiclass_utils.py b/pytorch_tabnet/multiclass_utils.py index 2f4b44aa..0a0a26a7 100644 --- a/pytorch_tabnet/multiclass_utils.py +++ b/pytorch_tabnet/multiclass_utils.py @@ -67,7 +67,11 @@ def _unique_indicator(y): """ Not implemented """ - pass + raise IndexError( + f"""Given labels are of size {y.shape} while they should be (n_samples,) \n""" + + """If attempting multilabel classification, try using TabNetMultiTaskClassification """ + + """or TabNetRegressor""" + ) _FN_UNIQUE_LABELS = {