File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -556,11 +556,8 @@ def buildDecisionTree(
556
556
557
557
# ---------------------------
558
558
# add else condition in the decision tree
559
-
560
559
if df .Decision .dtypes == "object" : # classification
561
- pivot = pd .DataFrame (subdataset .Decision .value_counts ()).sort_values (
562
- by = ["count" ], ascending = False
563
- )
560
+ pivot = pd .DataFrame (df .Decision .value_counts ()).sort_values (by = ["count" ], ascending = False )
564
561
else_decision = f"return '{ str (pivot .iloc [0 ].name )} '"
565
562
566
563
if enableParallelism != True :
@@ -588,7 +585,7 @@ def buildDecisionTree(
588
585
decision_rules .append (sample_rule )
589
586
590
587
else : # regression
591
- else_decision = f"return { subdataset .Decision .mean ()} "
588
+ else_decision = f"return { df .Decision .mean ()} "
592
589
593
590
if enableParallelism != True :
594
591
functions .storeRule (file , (functions .formatRule (root ), "else:" ))
You can’t perform that action at this time.
0 commit comments