Skip to content

Commit a555337

Browse files
committed
Add time-based ordering helpers
1 parent 979a1c1 commit a555337

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

dataikuapi/dss/ml.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,26 @@ def unset_time_ordering(self):
170170

171171
return self
172172

173+
def get_time_ordering_variable(self):
174+
"""
175+
:return: the name of the variable
176+
:rtype: str
177+
"""
178+
if self.mltask_settings.get('time', None) and self.mltask_settings['time']['enabled']:
179+
return self.mltask_settings['time']['timeVariable']
180+
else:
181+
warnings.warn("Time-based ordering is disabled in the current MLTask")
182+
183+
def is_time_ordering_ascending(self):
184+
"""
185+
:return: True if the ordering is set to be ascending with respect to the time-ordering variable
186+
:rtype: bool
187+
"""
188+
if self.mltask_settings.get('time', None) and self.mltask_settings['time']['enabled']:
189+
return self.mltask_settings['time']['ascending']
190+
else:
191+
warnings.warn("Time-based ordering is disabled in the current MLTask")
192+
173193

174194
class DSSMLTaskSettings(object):
175195
"""

0 commit comments

Comments
 (0)