Skip to content

Commit 2c79ed3

Browse files
committed
Update task type logic for dataframes / datasets
1 parent 3d75cf8 commit 2c79ed3

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

examples/tabular-classification/churn-classifier/churn-classifier-sklearn.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
" class_names=class_names,\n",
255255
" label_column_name='churn',\n",
256256
" commit_message='first version',\n",
257-
" task_type=TaskType.TabularClassification,\n",
258257
" feature_names=feature_names,\n",
259258
" categorical_feature_names=[\"Gender\", \"Geography\"],\n",
260259
")\n",

unboxapi/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ def add_model(
447447
endpoint = f"projects/{project_id}/ml-models"
448448
payload = dict(
449449
name=name,
450+
taskType=task_type.value,
450451
commitMessage=commit_message,
451452
classNames=class_names,
452453
architectureType=model_type.name,

unboxapi/projects.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ def add_dataset(
5151
*args,
5252
**kwargs,
5353
) -> Dataset:
54-
kwargs["project_id"] = self.id
55-
return self.client.add_dataset(*args, **kwargs)
54+
return self.client.add_dataset(
55+
*args, project_id=self.id, task_type=tasks.TaskType(self.taskType), **kwargs
56+
)
5657

5758
def add_dataframe(self, *args, **kwargs) -> Dataset:
58-
kwargs["project_id"] = self.id
59-
return self.client.add_dataframe(*args, **kwargs)
59+
return self.client.add_dataframe(
60+
*args, project_id=self.id, task_type=tasks.TaskType(self.taskType), **kwargs
61+
)

0 commit comments

Comments
 (0)