@@ -108,6 +108,9 @@ def create_project(
108
108
.. important::
109
109
The project name must be unique in a user's collection of projects.
110
110
111
+ task_type : :obj:`TaskType`
112
+ Type of ML task. E.g. :obj:`TaskType.TabularClassification` or :obj:`TaskType.TextClassification`.
113
+
111
114
description : str
112
115
Project description.
113
116
@@ -124,7 +127,9 @@ def create_project(
124
127
>>> import unboxapi
125
128
>>> client = unboxapi.UnboxClient('YOUR_API_KEY_HERE')
126
129
>>>
130
+ >>> from unboxapi.tasks import TaskType
127
131
>>> project = client.create_project(name="Churn prediction",
132
+ ... task_type=TaskType.TabularClassification,
128
133
... description="My first error analysis playground")
129
134
130
135
With the Project object created, you are able to start uploading models and datasets
@@ -221,9 +226,6 @@ def add_model(
221
226
with a ``name`` that still does not exist inside the project, Unbox treats it as the **first version** of a new model lineage.
222
227
On the other hand, if a model with the specified ``name`` already exists inside the project, Unbox treats it as a **new version**
223
228
of an existing model lineage.
224
-
225
- task_type : :obj:`TaskType`
226
- Type of ML task. E.g. :obj:`TaskType.TextClassification`.
227
229
function :
228
230
Prediction function object in expected format. Scroll down for examples.
229
231
@@ -289,7 +291,9 @@ def add_model(
289
291
290
292
Then, get the project object. If you don't have a project yet, you need to create one using the :obj:`create_project` method:
291
293
294
+ >>> from unboxapi.tasks import TaskType
292
295
>>> project = client.create_project(name="Your project name",
296
+ ... task_type=TaskType.TabularClassification, # or some other TaskType
293
297
... description="Your project description")
294
298
295
299
Otherwise, if you already have a project created on the platform, you just need to load it using the :obj:`load_project` method:
@@ -311,7 +315,6 @@ def add_model(
311
315
312
316
>>> from unboxapi import TaskType
313
317
>>>
314
- >>> task_type = TaskType.TabularClassification
315
318
>>> class_names = ['Retained', 'Churned']
316
319
>>> feature_names = ['CreditScore', 'Geography', 'Balance']
317
320
>>> categorical_feature_names = ['Geography']
@@ -367,7 +370,6 @@ def add_model(
367
370
>>> model = project.add_model(
368
371
... name='Linear classifier',
369
372
... commit_message='First iteration of vanilla logistic regression',
370
- ... task_type=task_type,
371
373
... function=predict_proba,
372
374
... model=sklearn_model,
373
375
... model_type=model_type,
@@ -390,11 +392,8 @@ def add_model(
390
392
2 Things are looking up 1
391
393
.. ... ...
392
394
393
- The first set of variables needed by Unbox are :
395
+ The first variable needed by Unbox is :
394
396
395
- >>> from unboxapi import TaskType
396
- >>>
397
- >>> task_type = TaskType.TextClassification
398
397
>>> class_names = ['Negative', 'Positive']
399
398
400
399
Now let's say you've trained a simple ``scikit-learn`` model on data that looks like the above.
@@ -444,7 +443,7 @@ def add_model(
444
443
445
444
>>> model = project.add_model(
446
445
... name='Linear classifier',
447
- ... task_type=task_type ,
446
+ ... commit_message='First iteration of vanilla logistic regression' ,
448
447
... function=predict_proba,
449
448
... model=sklearn_model,
450
449
... model_type=model_type,
@@ -719,8 +718,6 @@ def add_dataset(
719
718
720
719
Parameters
721
720
----------
722
- task_type : :obj:`TaskType`
723
- Type of ML task. E.g. :obj:`TaskType.TextClassification`.
724
721
file_path : str
725
722
Path to the csv file containing the dataset.
726
723
class_names : List[str]
@@ -775,7 +772,9 @@ def add_dataset(
775
772
776
773
Then, get the project object. If you don't have a project yet, you need to create one using the :obj:`create_project` method:
777
774
775
+ >>> from unboxapi.tasks import TaskType
778
776
>>> project = client.create_project(name="Your project name",
777
+ ... task_type=TaskType.TabularClassification, # or some other TaskType
779
778
... description="Your project description")
780
779
781
780
Otherwise, if you already have a project created on the platform, you just need to load it using the :obj:`load_project` method:
@@ -799,9 +798,6 @@ def add_dataset(
799
798
800
799
The variables are needed by Unbox are:
801
800
802
- >>> from unboxapi import TaskType
803
- >>>
804
- >>> task_type = TaskType.TabularClassification
805
801
>>> class_names = ['Retained', 'Churned']
806
802
>>> feature_names = ['CreditScore', 'Geography', 'Balance']
807
803
>>> label_column_name = 'Churned'
@@ -810,7 +806,6 @@ def add_dataset(
810
806
You can now upload this dataset to Unbox:
811
807
812
808
>>> dataset = client.add_dataset(
813
- ... task_type=task_type,
814
809
... file_path='/path/to/dataset.csv',
815
810
... commit_message="First commit!",
816
811
... class_names=class_names,
@@ -833,18 +828,15 @@ def add_dataset(
833
828
834
829
The variables are needed by Unbox are:
835
830
836
- >>> from unboxapi import TaskType
837
- >>>
838
- >>> task_type = TaskType.TextClassification
839
831
>>> class_names = ['Negative', 'Positive']
840
832
>>> text_column_name = 'Text'
841
833
>>> label_column_name = 'Sentiment'
842
834
843
835
You can now upload this dataset to Unbox:
844
836
845
837
>>> dataset = client.add_dataset(
846
- ... task_type=task_type,
847
838
... file_path='/path/to/dataset.csv',
839
+ ... commit_message="First commit!",
848
840
... class_names=class_names,
849
841
... label_column_name=label_column_name,
850
842
... text_column_name=text_column_name,
@@ -1004,8 +996,6 @@ def add_dataframe(
1004
996
1005
997
Parameters
1006
998
----------
1007
- task_type : :obj:`TaskType`
1008
- Type of ML task. E.g. :obj:`TaskType.TextClassification`.
1009
999
df : pd.DataFrame
1010
1000
Dataframe containing your dataset.
1011
1001
class_names : List[str]
@@ -1058,7 +1048,9 @@ def add_dataframe(
1058
1048
1059
1049
Then, get the project object. If you don't have a project yet, you need to create one using the :obj:`create_project` method:
1060
1050
1051
+ >>> from unboxapi.tasks import TaskType
1061
1052
>>> project = client.create_project(name="Your project name",
1053
+ ... task_type=TaskType.TabularClassification # or some other TaskType
1062
1054
... description="Your project description")
1063
1055
1064
1056
Otherwise, if you already have a project created on the platform, you just need to load it using the :obj:`load_project` method:
@@ -1081,9 +1073,6 @@ def add_dataframe(
1081
1073
1082
1074
The variables are needed by Unbox are:
1083
1075
1084
- >>> from unboxapi import TaskType
1085
- >>>
1086
- >>> task_type = TaskType.TabularClassification
1087
1076
>>> class_names = ['Retained', 'Churned']
1088
1077
>>> feature_names = ['CreditScore', 'Geography', 'Balance']
1089
1078
>>> label_column_name = 'Churned'
@@ -1092,7 +1081,6 @@ def add_dataframe(
1092
1081
You can now upload this dataset to Unbox:
1093
1082
1094
1083
>>> dataset = client.add_dataset(
1095
- ... task_type=task_type,
1096
1084
... df=df,
1097
1085
... commit_message="First commit!",
1098
1086
... class_names=class_names,
@@ -1114,17 +1102,13 @@ def add_dataframe(
1114
1102
1115
1103
The variables are needed by Unbox are:
1116
1104
1117
- >>> from unboxapi import TaskType
1118
- >>>
1119
- >>> task_type = TaskType.TextClassification
1120
1105
>>> class_names = ['Negative', 'Positive']
1121
1106
>>> text_column_name = 'Text'
1122
1107
>>> label_column_name = 'Sentiment'
1123
1108
1124
1109
You can now upload this dataset to Unbox:
1125
1110
1126
1111
>>> dataset = client.add_dataset(
1127
- ... task_type=task_type,
1128
1112
... df=df,
1129
1113
... commit_message="First commit!",
1130
1114
... class_names=class_names,
0 commit comments