@@ -125,13 +125,13 @@ def set_split_explicit(self, train_selection, test_selection, dataset_name=None,
125125
126126 return self
127127
128- def set_order_by (self , feature_name , ascending = True ):
128+ def set_time_ordering (self , feature_name , ascending = True ):
129129 """
130- Uses a variable to sort the data for train/test split and hyperparameter optimization
130+ Uses a variable to sort the data for train/test split and hyperparameter optimization by time
131131 :param str feature_name: Name of the variable to use
132132 :param bool ascending: True iff the test set is expected to have larger time values than the train set
133133 """
134- self .unset_order_by ()
134+ self .unset_time_ordering ()
135135 if not feature_name in self .mltask_settings ["preprocessing" ]["per_feature" ]:
136136 raise ValueError ("Feature %s doesn't exist in this ML task, can't use as time" % feature_name )
137137 self .mltask_settings ['time' ]['enabled' ] = True
@@ -148,9 +148,9 @@ def set_order_by(self, feature_name, ascending=True):
148148
149149 return self
150150
151- def unset_order_by (self ):
151+ def unset_time_ordering (self ):
152152 """
153- Remove time-based ordering.
153+ Remove time-based ordering for train/test split and hyperparameter optimization
154154 """
155155 self .mltask_settings ['time' ]['enabled' ] = False
156156 self .mltask_settings ['time' ]['timeVariable' ] = None
@@ -187,28 +187,6 @@ def get_raw(self):
187187 """
188188 return self .mltask_settings
189189
190- def get_split_params (self ):
191- """
192- Gets a handle to modify train/test splitting params.
193-
194- :rtype: :class:`PredictionSplitParamsHandler`
195- """
196- raise NotImplementedError ("get_split_params not available for class {}" .format (self .__class__ ))
197-
198- def split_ordered_by (self , feature_name , ascending = True ):
199- """
200- Uses a variable to sort the data for train/test split and hyperparameter optimization
201- :param str feature_name: Name of the variable to use
202- :param bool ascending: True iff the test set is expected to have larger time values than the train set
203- """
204- raise NotImplementedError ("split_ordered_by not available for class {}" .format (self .__class__ ))
205-
206- def remove_ordered_split (self ):
207- """
208- Remove time-based ordering.
209- """
210- raise NotImplementedError ("remove_ordered_split not available for class {}" .format (self .__class__ ))
211-
212190 def get_feature_preprocessing (self , feature_name ):
213191 """
214192 Gets the feature preprocessing params for a particular feature. This returns a reference to the
@@ -249,18 +227,6 @@ def use_feature(self, feature_name):
249227 """
250228 self .get_feature_preprocessing (feature_name )["role" ] = "INPUT"
251229
252- def use_sample_weighting (self , feature_name ):
253- """
254- Deprecated. Will be removed from DSSMLTaskSettings class
255- """
256- raise NotImplementedError ("use_sample_weighting() not available for class {}" .format (self .__class__ ))
257-
258- def remove_sample_weighting (self ):
259- """
260- Deprecated. Will be removed from DSSMLTaskSettings class
261- """
262- raise NotImplementedError ("remove_sample_weighting() not available for class {}" .format (self .__class__ ))
263-
264230 def get_algorithm_settings (self , algorithm_name ):
265231 """
266232 Gets the training settings for a particular algorithm. This returns a reference to the
@@ -419,31 +385,21 @@ def get_split_params(self):
419385 """
420386 return PredictionSplitParamsHandler (self .mltask_settings )
421387
422- @split_params .setter
423- def split_params (self , value ):
424- raise AttributeError ("split_params reference cannot be overwritten, get a handle and modify it with a set method instead" )
425-
426388 def split_ordered_by (self , feature_name , ascending = True ):
427389 """
428- Uses a variable to sort the data for train/test split and hyperparameter optimization
429- :param str feature_name: Name of the variable to use
430- :param bool ascending: True iff the test set is expected to have larger time values than the train set
431-
432- :rtype: self
390+ Deprecated. Use split_params.set_time_ordering()
433391 """
434- warnings .warn ("split_ordered_by() is deprecated, please use split_params.set_order_by () instead" , DeprecationWarning )
435- self .split_params .set_order_by (feature_name , ascending = True )
392+ warnings .warn ("split_ordered_by() is deprecated, please use split_params.set_time_ordering () instead" , DeprecationWarning )
393+ self .split_params .set_time_ordering (feature_name , ascending = ascending )
436394
437395 return self
438396
439397 def remove_ordered_split (self ):
440398 """
441- Remove time-based ordering.
442-
443- :rtype: self
399+ Deprecated. Use split_params.unset_time_ordering()
444400 """
445- warnings .warn ("remove_ordered_split() is deprecated, please use split_params.unset_order_by () instead" , DeprecationWarning )
446- self .split_params .unset_order_by ()
401+ warnings .warn ("remove_ordered_split() is deprecated, please use split_params.unset_time_ordering () instead" , DeprecationWarning )
402+ self .split_params .unset_time_ordering ()
447403
448404 return self
449405
@@ -456,8 +412,10 @@ def use_sample_weighting(self, feature_name):
456412
457413 def set_weighting (self , method , feature_name = None ):
458414 """
459- Uses a feature as sample weight
460- :param str feature_name: Name of the feature to use
415+ Sets the method to weight samples.
416+ :param str method: Method to use. One of NO_WEIGHTING, SAMPLE_WEIGHT (must give a feature name),
417+ CLASS_WEIGHT or CLASS_AND_SAMPLE_WEIGHT (must give a feature name)
418+ :param str feature_name: Name of the feature to use as sample weight
461419 """
462420 self .unset_weighting ()
463421
0 commit comments