File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -917,7 +917,7 @@ def _no_targets_no_thresholds(
917
917
cls .score_code += f"{ '' :4} { metrics [0 ]} = prediction[1][0]\n "
918
918
for i in range (len (metrics ) - 1 ):
919
919
cls .score_code += (
920
- f"{ '' :4} { metrics [i + 1 ]} = prediction[1][{ i + 1 } ]\n "
920
+ f"{ '' :4} { metrics [i + 1 ]} = float( prediction[1][{ i + 1 } ]) \n "
921
921
)
922
922
else :
923
923
for i in range (len (metrics )):
@@ -1018,7 +1018,8 @@ def _binary_target(
1018
1018
"score code should output the classification and probability for "
1019
1019
"the target event to occur."
1020
1020
)
1021
- cls .score_code += f"{ '' :4} return prediction[1][0], prediction[1][2]"
1021
+ cls .score_code += f"{ '' :4} return prediction[1][0], " \
1022
+ f"float(prediction[1][2])"
1022
1023
# Calculate the classification; return the classification and probability
1023
1024
elif sum (returns ) == 0 and len (returns ) == 1 :
1024
1025
warn (
@@ -1069,7 +1070,8 @@ def _binary_target(
1069
1070
elif len (metrics ) == 3 :
1070
1071
if h2o_model :
1071
1072
cls .score_code += (
1072
- f"{ '' :4} return prediction[1][0], prediction[1][1], prediction[1][2]"
1073
+ f"{ '' :4} return prediction[1][0], float(prediction[1][1]), "
1074
+ f"float(prediction[1][2])"
1073
1075
)
1074
1076
elif sum (returns ) == 0 and len (returns ) == 1 :
1075
1077
warn (
You can’t perform that action at this time.
0 commit comments