From fd0d0ddb88fc3548546c198476dc025829ed0f79 Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Sat, 23 Dec 2023 12:11:57 +0000 Subject: [PATCH] auto linting --- chefboost/training/Training.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chefboost/training/Training.py b/chefboost/training/Training.py index 1446211..0aa9f1e 100644 --- a/chefboost/training/Training.py +++ b/chefboost/training/Training.py @@ -511,12 +511,12 @@ def buildDecisionTree( if df.Decision.dtypes == "object": # classification pivot = pd.DataFrame(subdataset.Decision.value_counts()).reset_index() - + if pd.__version__.split(".")[0] == "1": pivot = pivot.rename(columns={"Decision": "Instances", "index": "Decision"}) - else: # if pd.__version__.split(".")[0] == "2": + else: # if pd.__version__.split(".")[0] == "2": pivot = pivot.rename(columns={"Decision": "Instances", "count": "Decision"}) - + pivot = pivot.sort_values(by=["Instances"], ascending=False).reset_index() else_decision = f"return '{pivot.iloc[0].Decision}'"