From 91fb2824f5cdcc899811b8a26e01c4d994d8d954 Mon Sep 17 00:00:00 2001 From: Ishtiaq Hussain <53497039+Ishticode@users.noreply.github.com> Date: Fri, 1 Dec 2023 18:20:56 +0000 Subject: [PATCH] feat: add custom sort function for DensePartitions's sort_samples_and_feature_values --- ivy/functional/frontends/sklearn/tree/_splitter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ivy/functional/frontends/sklearn/tree/_splitter.py b/ivy/functional/frontends/sklearn/tree/_splitter.py index c222d7361d41f..037233038533f 100644 --- a/ivy/functional/frontends/sklearn/tree/_splitter.py +++ b/ivy/functional/frontends/sklearn/tree/_splitter.py @@ -274,4 +274,7 @@ def node_split_best( def sort(feature_values, samples, n): - return 0, 0 + if n == 0: + return + idx = ivy.argsort(feature_values) + return feature_values[idx], samples[idx]