Skip to content

Commit 5f3b342

Browse files
committed
Merge remote-tracking branch 'origin/release/10.0'
2 parents fcaf895 + ce9b441 commit 5f3b342

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

dataikuapi/dss/recipe.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,12 @@ class StandaloneEvaluationRecipeCreator(DSSRecipeCreator):
14301430
builder.with_input("scored_dataset_to_evaluate")
14311431
builder.with_output_evaluation_store(evaluation_store_id)
14321432
1433+
# Add a reference dataset (optional) to compute data drift
1434+
1435+
builder.with_reference_dataset("reference_dataset")
1436+
1437+
# Finish creation of the recipe
1438+
14331439
new_recipe = builder.create()
14341440
14351441
# Modify the model parameters in the SER settings
@@ -1484,6 +1490,10 @@ def with_output_evaluation_store(self, mes_id):
14841490
"""Sets the output model evaluation store"""
14851491
return self._with_output(mes_id, role="main")
14861492

1493+
def with_reference_dataset(self, dataset_name):
1494+
"""Sets the dataset to use as a reference in data drift computation (optional)."""
1495+
return self._with_input(dataset_name, self.project.project_key, role="reference")
1496+
14871497

14881498
class ClusteringScoringRecipeCreator(SingleOutputRecipeCreator):
14891499
"""

dataikuapi/dssclient.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,19 @@ def apply_kubernetes_namespaces_policies(self):
10331033
resp = self._perform_json("POST", "/admin/container-exec/actions/apply-kubernetes-policies")
10341034
return DSSFuture.from_resp(self, resp)
10351035

1036+
1037+
########################################################
1038+
# Global Instance Info
1039+
########################################################
1040+
1041+
def get_instance_info(self):
1042+
"""
1043+
Get global information about the DSS instance
1044+
:return: a :classss:`DSSInstanceInfo`
1045+
"""
1046+
resp = self._perform_json("GET", "/instance-info")
1047+
return DSSInstanceInfo(resp)
1048+
10361049
########################################################
10371050
# Licensing
10381051
########################################################
@@ -1171,3 +1184,33 @@ def execute(self, settings=None):
11711184
settings["_"] = "_"
11721185
return self.client._perform_json("POST", "/projects/import/%s/process" % (self.import_id),
11731186
body = settings)
1187+
1188+
class DSSInstanceInfo(object):
1189+
"""Global information about the DSS instance"""
1190+
1191+
def __init__(self, data):
1192+
"""Do not call this directly, use :meth:`DSSClient.get_instance_info`"""
1193+
self._data = data
1194+
1195+
@property
1196+
def raw(self):
1197+
"""Returns all data as a Python dictionary"""
1198+
return self._data
1199+
1200+
@property
1201+
def node_id(self):
1202+
"""Returns the node id (as defined in Cloud Stacks or in install.ini)"""
1203+
return self._data["nodeId"]
1204+
1205+
@property
1206+
def node_name(self):
1207+
"""Returns the node name as it appears in the navigation bar"""
1208+
return self._data["nodeName"]
1209+
1210+
@property
1211+
def node_type(self):
1212+
"""
1213+
Returns the node type
1214+
:return: One of DESIGN, AUTOMATION or DEPLOYER
1215+
"""
1216+
return self._data["nodeType"]

0 commit comments

Comments
 (0)