Skip to content

Commit

Permalink
added support for passthrough conn to stacking est
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Kostromin <kostromin97@gmail.com>
  • Loading branch information
OKUA1 committed Oct 30, 2022
1 parent 7bfcd52 commit 09c731c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions skl2onnx/operator_converters/stacking.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ def _fetch_scores(scope, container, model, inputs, raw_scores=False,
return new_name


def _add_passthrough_connection(operator, predictions):
if operator.raw_operator.passthrough:
predictions.append(operator.inputs[0].onnx_name)


def _transform_regressor(scope, operator, container, model):
merged_prob_tensor = scope.get_unique_variable_name(
'merged_probability_tensor')
Expand All @@ -50,6 +55,8 @@ def _transform_regressor(scope, operator, container, model):
for est in model.estimators_
]

_add_passthrough_connection(operator, predictions)

apply_concat(
scope, predictions, merged_prob_tensor, container, axis=1)
return merged_prob_tensor
Expand Down Expand Up @@ -85,6 +92,8 @@ def _transform(scope, operator, container, model):
new_predictions.append(prob1)
predictions = new_predictions

_add_passthrough_connection(operator, predictions)

apply_concat(
scope, predictions, merged_prob_tensor, container, axis=1)
return merged_prob_tensor
Expand Down

0 comments on commit 09c731c

Please sign in to comment.