11from ..utils import DataikuException
22from ..utils import DataikuUTF8CSVReader
33from ..utils import DataikuStreamedHttpUTF8CSVReader
4- import json , warnings
4+ import json, warnings
55import time
66from .metrics import ComputedMetrics
77from .utils import DSSDatasetSelectionBuilder, DSSFilterBuilder
@@ -47,6 +47,8 @@ def set_split_random(self, train_ratio = 0.8, selection = None, dataset_name=Non
4747 if dataset_name is not None:
4848 sp["ssdDatasetSmartName"] = dataset_name
4949
50+ return self
51+
5052 def set_split_kfold(self, n_folds = 5, selection = None, dataset_name=None):
5153 """
5254 Sets the train/test split to k-fold splitting of an extract of a single dataset
@@ -69,6 +71,8 @@ def set_split_kfold(self, n_folds = 5, selection = None, dataset_name=None):
6971 if dataset_name is not None:
7072 sp["ssdDatasetSmartName"] = dataset_name
7173
74+ return self
75+
7276 def set_split_explicit(self, train_selection, test_selection, dataset_name=None, test_dataset_name=None, train_filter=None, test_filter=None):
7377 """
7478 Sets the train/test split to explicit extract of one or two dataset(s)
@@ -119,6 +123,8 @@ def set_split_explicit(self, train_selection, test_selection, dataset_name=None,
119123 else:
120124 test_split["filter"] = test_filter
121125
126+ return self
127+
122128 def set_order_by(self, feature_name, ascending=True):
123129 """
124130 Uses a variable to sort the data for train/test split and hyperparameter optimization
0 commit comments