-   Notifications  You must be signed in to change notification settings 
- Fork 1
Completes UNB-2346 - Update Python API reference #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completes UNB-2346 - Update Python API reference #31
Conversation
   unboxapi/__init__.py  Outdated    
 | >>> model = client.add_model( | ||
| ... name='Churn Classifier', | ||
| >>> model = project.add_model( | ||
| ... name='Linear classifiers', | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this name singular? I don't want users to think "Linear classifiers" should be used to compare several different candidates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
   unboxapi/__init__.py  Outdated    
 | on that new tree. In the future, if you'd like to commit a new version to that same lineage, you can simply call `add_model` | ||
| using ``name='Linear classifier'`` again and use ``description`` with the new commit message. Alternatively, if you'd like | ||
| to start a new separate lineage inside that project, you can call the ``add_model`` method with a different ``name``, e.g., | ||
| ``name ='Nonlinear classifiers'``. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you confuse "Linear classifier" with "Linear classifiers"
Make everything just "Linear Classifier" pls
   unboxapi/__init__.py  Outdated    
 | categorical_features_map : Dict[str, List[str]], default {} | ||
| A dict containing a list of category names for each feature that is categorical. E.g. `{'Weather': ['Hot', 'Cold']}`. | ||
| categorical_feature_names : List[str], default [] | ||
| A list containing the feature names for each feature that is categorical. E.g. `["Gender", "Geography"]`. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you improve this wording? "The feature names for each feature" is awkward
"A list containing the names of all categorical features used by the model. ..."
   unboxapi/__init__.py  Outdated    
 | Examples | ||
| -------- | ||
| Instantiate the client: | ||
| The datasets are uploaded directly into a **project** on the Unbox platform, using the ``project.add_dataset()`` method. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Datasets are uploaded. No need for "The datasets"
   unboxapi/__init__.py  Outdated    
 | -------- | ||
| Instantiate the client | ||
| The dataframes are uploaded directly into a **project** on the Unbox platform, using the ``project.add_dataframe()`` method. | ||
| Therefore, you need to get the project object to start uploading your dataframes. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can get rid of these first two sentences in all the examples sections. Show, don't tell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I'll remove them
   unboxapi/__init__.py  Outdated    
 | .. important:: | ||
| The project name must be unique in a user's account. Furthermore, this is the name | ||
| that is used to identify the project when uploading models and datasets. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reword: This name must be unique within a user's collection of projects.
Don't think the second line is needed
   unboxapi/__init__.py  Outdated    
 | .. important:: | ||
| Versioning models on the Unbox platform happens via the ``name`` argument. If ``add_model`` is called | ||
| with a ``name`` that still does not exist inside the project, Unbox treats it as the **first version** of a new model lineage. | ||
| On the other hand, if the ``name`` argument value already exists inside the project, Unbox treats it as a **new version** of an existing | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"if the name argument value already exists" --> "if a model with the specified name already exists"
| The ``model`` arg must be the actual trained model object, and the ``input_features`` arg must be a 2D numpy array | ||
| containing a batch of features that will be passed to the model as inputs. | ||
| You can optionally include other kwargs in the function, including tokenizers, variables, encoders etc. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious why you removed tokenizers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, just because this is inside the example for tabular classification. I kept it for the example for NLP.
I'm trying to think now of uses of a tokenizer on a tabular task type... I think it would be a bit unusual, but I guess it can exist. I'll add it back just in case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no, you're right. Keep it removed for tabular :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to merge after addressing my comments
   unboxapi/__init__.py  Outdated    
 | >>> model = client.add_model( | ||
| ... name='Churn Classifier', | ||
| >>> model = project.add_model( | ||
| ... name='Linear classifiers', | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still plural
   unboxapi/__init__.py  Outdated    
 | categorical_features_map : Dict[str, List[str]], default {} | ||
| A dict containing a list of category names for each feature that is categorical. E.g. `{'Weather': ['Hot', 'Cold']}`. | ||
| categorical_feature_names : List[str], default [] | ||
| A list containing the names of all categorical features on the dataset. E.g. `["Gender", "Geography"]`. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
general grammar comment -- you occasionally use "on" instead of "in." This should be "A list containing the names of all categorical features in the dataset"
   unboxapi/__init__.py  Outdated    
 | categorical_features_map : Dict[str, List[str]], default {} | ||
| A dict containing a list of category names for each feature that is categorical. E.g. `{'Weather': ['Hot', 'Cold']}`. | ||
| categorical_feature_names : List[str], default [] | ||
| A list containing the names of all categorical features on the dataframe. E.g. `["Gender", "Geography"]`. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on -> in
Updated docstrings to be consistent with the
project.add_XXXdynamic and with the deprecation ofcategorical_features_mapin favor ofcategorical_feature_names.Points that still need to be resolved:
add_model,add_dataset, andadd_dataframetoprojects.py. Otherwise, the organization is not ideal, as it seems likeadd_XXXis a method of theUnboxClientclass (it is, but that's not the dynamic we'd like to communicate). I didn't move it all because insideprojects.py, theadd_XXXmethods don't have the arguments properly defined like the methods in theUnboxClientclass (i.e., we use*args, **kwargs).