Skip to content

Commit fd1817b

Browse files
committed
Black reformatting
1 parent 23b0238 commit fd1817b

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

src/sasctl/pzmm/modelParameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,4 @@ def sklearn_params(model, modelPrefix, pPath):
158158
with open(
159159
Path(pPath) / ("{}Hyperparameters.json".format(modelPrefix)), "w"
160160
) as f:
161-
f.write(json.dumps(modelJson, indent=4))
161+
f.write(json.dumps(modelJson, indent=4))

src/sasctl/pzmm/writeScoreCode.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,10 @@ def score{modelPrefix}({inputVarList}):
475475
# For models that output the classification from the prediction
476476
cls.pyFile.write(
477477
"""\n
478-
{metric} = prediction""".format(metric=metrics[0]))
478+
{metric} = prediction""".format(
479+
metric=metrics[0]
480+
)
481+
)
479482
elif len(metrics) == 2:
480483
cls.pyFile.write(
481484
"""\n
@@ -484,7 +487,10 @@ def score{modelPrefix}({inputVarList}):
484487
except TypeError:
485488
# If the prediction returns as a list of values or improper value type, a TypeError will be raised.
486489
# Attempt to handle the prediction output in the except block.
487-
{metric} = float(prediction[0])""".format(metric=metrics[0]))
490+
{metric} = float(prediction[0])""".format(
491+
metric=metrics[0]
492+
)
493+
)
488494
if threshPrediction is None:
489495
threshPrediction = np.mean(targetDF)
490496
cls.pyFile.write(
@@ -502,16 +508,22 @@ def score{modelPrefix}({inputVarList}):
502508
for i, metric in enumerate(metrics[:-1]):
503509
cls.pyFile.write(
504510
"""\
505-
{metric} = float(prediction[{i}]""".format(metric=metric, i=i)
511+
{metric} = float(prediction[{i}]""".format(
512+
metric=metric, i=i
513+
)
506514
)
507515
cls.pyFile.write(
508516
"""\
509517
max_prediction = max({metric_list})
510518
index_prediction = {metric_list}.index(max_prediction)
511-
{classification} = index_prediction""".format(metric_list=metrics[:-1], classification=metrics[-1])
519+
{classification} = index_prediction""".format(
520+
metric_list=metrics[:-1], classification=metrics[-1]
521+
)
512522
)
513523
else:
514-
ValueError("Improper metrics argument was provided. Please provide a list of string metrics.")
524+
ValueError(
525+
"Improper metrics argument was provided. Please provide a list of string metrics."
526+
)
515527

516528
elif isH2OModel and not isMLFlow:
517529
cls.pyFile.write(

0 commit comments

Comments
 (0)