Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion supervised/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,13 @@ def load(results_path, model_subpath, models_map):
{"model": models_map[m["model"]], "repeat": m["repeat"]}
]

ensemble.best_loss = json_desc.get("final_loss", ensemble.best_loss)
best_loss = json_desc.get("final_loss", ensemble.best_loss)
if best_loss is not None:
try:
best_loss = float(best_loss)
except ValueError:
pass
ensemble.best_loss = best_loss
ensemble.train_time = json_desc.get("train_time", ensemble.train_time)
ensemble._is_stacked = json_desc.get("is_stacked", ensemble._is_stacked)
predictions_fname = json_desc.get("predictions_fname")
Expand Down
10 changes: 8 additions & 2 deletions supervised/model_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ def save(self, results_path, model_subpath):
"is_stacked": self._is_stacked,
"joblib_version": joblib.__version__,
}
desc["final_loss"] = str(desc["final_loss"])
desc["final_loss"] = desc["final_loss"]
if self._threshold is not None:
desc["threshold"] = self._threshold
if self._single_prediction_time is not None:
Expand Down Expand Up @@ -707,7 +707,13 @@ def load(results_path, model_subpath, lazy_load=True):
mf._name = json_desc.get("name", mf._name)
mf._threshold = json_desc.get("threshold")
mf.train_time = json_desc.get("train_time", mf.train_time)
mf.final_loss = json_desc.get("final_loss", mf.final_loss)
final_loss = json_desc.get("final_loss", mf.final_loss)
if final_loss is not None:
try:
final_loss = float(final_loss)
except ValueError:
pass
mf.final_loss = final_loss
mf.metric_name = json_desc.get("metric_name", mf.metric_name)
mf._is_stacked = json_desc.get("is_stacked", mf._is_stacked)
mf._single_prediction_time = json_desc.get(
Expand Down