Skip to content

Commit

Permalink
Generalize loss_function serializer (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
AHReccese authored Jan 20, 2024
1 parent 86ce501 commit 116416d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pymilo/transporters/lossfunction_transporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def serialize(self, data, key, model_type):
:return: pymilo serialized output of data[key]
"""
if (
(model_type == "SGDClassifier" and key == "loss_function_") or
(model_type == "SGDOneClassSVM" and key == "loss_function_") or
(model_type == "Perceptron" and key == "loss_function_") or
(model_type == "PassiveAggressiveClassifier" and key == "loss_function_")
(model_type == "SGDClassifier" and (key == "loss_function_" or key == "_loss_function_")) or
(model_type == "SGDOneClassSVM" and (key == "loss_function_" or key == "_loss_function_")) or
(model_type == "Perceptron" and (key == "loss_function_" or key == "_loss_function_")) or
(model_type == "PassiveAggressiveClassifier" and (key == "loss_function_" or key == "_loss_function_"))
):
data[key] = {
"loss": data["loss"]
Expand Down

0 comments on commit 116416d

Please sign in to comment.