From d2443ca23670d07107ea4ae88762ab31b4e91d91 Mon Sep 17 00:00:00 2001 From: JulZimmermann Date: Wed, 23 Feb 2022 17:05:21 +0100 Subject: [PATCH] Allow empty array as feature_names_out (#832) I don't understand why this should be not allowed. We use a feature filter step in our pipeline which filters away all features in some cases. This used to work fine with older versions of sklearn before `feature_names_out` and `feature_names_in` were introduced. Unfortunately, our converter doesn't work anymore because of this check. Removing it resolves the problem. Signed-off-by: Julian Zimmermann --- skl2onnx/_parse.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/skl2onnx/_parse.py b/skl2onnx/_parse.py index 8a9e1ff6b..7d557a47b 100644 --- a/skl2onnx/_parse.py +++ b/skl2onnx/_parse.py @@ -230,10 +230,6 @@ def _parse_sklearn_simple_model(scope, model, inputs, custom_parsers=None, # Catch a bug in scikit-learn. out_names = None this_operator.feature_names_out_ = out_names - if out_names is not None and len(out_names) == 0: - raise RuntimeError( - "get_feature_names_out() cannot return an empty value, " - "model is %r." % type(model)) input_type = guess_tensor_type(inputs[0].type) variable = scope.declare_local_variable( 'variable', input_type)