Skip to content

Commit

Permalink
Update tree_ensemble_common.py (onnx#691)
Browse files Browse the repository at this point in the history
See issue onnx#688

Signed-off-by: tiago-rib-goncalves <159172975+tiago-rib-goncalves@users.noreply.github.com>
  • Loading branch information
tiago-rib-goncalves authored May 17, 2024
1 parent a105247 commit aa26b73
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def sparkml_tree_dataset_to_sklearn(tree_df, is_classifier):
if isinstance(item, dict):
try:
feature.append(item["featureIndex"])
threshold.append(item["leftCategoriesOrThreshold"])
threshold.append(item["leftCategoriesOrThreshold"][0] if len(item["leftCategoriesOrThreshold"]) >= 1 else -1.0)
except KeyError:
raise RuntimeError(f"Unable to process {item}.")
else:
Expand Down

0 comments on commit aa26b73

Please sign in to comment.