Skip to content

Commit 49d15fd

Browse files
author
kgued
committed
return self for all PredictionSplitParamsHandler setters
1 parent 16d2398 commit 49d15fd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dataikuapi/dss/ml.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from ..utils import DataikuException
22
from ..utils import DataikuUTF8CSVReader
33
from ..utils import DataikuStreamedHttpUTF8CSVReader
4-
import json , warnings
4+
import json, warnings
55
import time
66
from .metrics import ComputedMetrics
77
from .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

Comments
 (0)