Skip to content

Commit 6ccde56

Browse files
committed
ML API: add helper to retrieve hyperparameter search points
1 parent 9b095f2 commit 6ccde56

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

dataikuapi/dss/ml.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,22 @@ def get_performance_metrics(self):
544544
return clean_snippet
545545

546546

547+
def get_hyperparameter_search_points(self):
548+
"""
549+
Gets the list of points in the hyperparameter search space that have been tested.
550+
551+
Returns a list of dict. Each entry in the list represents a point.
552+
553+
For each point, the dict contains at least:
554+
- "score": the average value of the optimization metric over all the folds at this point
555+
- "params": a dict of the parameters at this point. This dict has the same structure
556+
as the params of the best parameters
557+
"""
558+
559+
if not "gridCells" in self.details["iperf"]:
560+
raise ValueError("No hyperparameter search result, maybe this model did not perform hyperparameter optimization")
561+
return self.details["iperf"]["gridCells"]
562+
547563
def get_preprocessing_settings(self):
548564
"""
549565
Gets the preprocessing settings that were used to train this model

0 commit comments

Comments
 (0)