Skip to content

Commit 71a0efa

Browse files
committed
get the session info in and out of the start_train
1 parent 5787dea commit 71a0efa

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

dataikuapi/dss/ml.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,14 +483,22 @@ def get_settings(self):
483483
else:
484484
return DSSClusteringMLTaskSettings(self.client, self.project_key, self.analysis_id, self.mltask_id, settings)
485485

486-
def start_train(self):
486+
def start_train(self, session_name=None, session_description=None):
487487
"""
488488
Starts asynchronously a new train session for this ML Task.
489489
490+
:param str session_name: name for the session
491+
:param str session_description: description for the session
492+
490493
This returns immediately, before train is complete. To wait for train to complete, use ``wait_train_complete()``
491494
"""
492-
self.client._perform_empty(
493-
"POST", "/projects/%s/models/lab/%s/%s/train" % (self.project_key, self.analysis_id, self.mltask_id))
495+
session_info = {
496+
"sessionName" : session_name,
497+
"sessionDescription" : session_description
498+
}
499+
500+
return self.client._perform_json(
501+
"POST", "/projects/%s/models/lab/%s/%s/train" % (self.project_key, self.analysis_id, self.mltask_id), body=session_info)
494502

495503
def wait_train_complete(self):
496504
"""

0 commit comments

Comments
 (0)