-
Notifications
You must be signed in to change notification settings - Fork 32
Conversation
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.
Most of my remarks are minor. Some of them follow from dynamic changes in the code. The comments will require rereading anyway once we have a mature version of the library.
@@ -3,51 +3,157 @@ | |||
|
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.
Since adapter syntax won't allow passing a function any more, purpose of functions in this module should be reconsidered. But for the time being I would leave them as they are.
step_3 = Step(name='step_3', | ||
input_steps=[step_1, step_2], | ||
input_data=['input_2'], | ||
adapter = {'X':([('step_1','X_transformed'), |
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.
Old adapter syntax.
But for now you can leave it as it is. Step API is probably going to change quite a few times before we get a "mature" version. Let's not waste too much time on polishing comments for each temporary version.
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.
Agreed
Args: | ||
name (int): Step name. Each step in a pipeline needs to have a unique name. | ||
Transformers, and Step outputs will be persisted/cached/saved under this exact name. | ||
transformer (obj): Step instance or object that inherits from BaseTransformer. |
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.
transformer (BaseTransformer)
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.
@grzes314 it is either BaseTransformer or Step how would you handle that?
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.
Do we really have a usecase when we would like to put a Step here instead of Transformer? Anyway, if we incorporate Michal's recent proposition, Step and Transformer will be unified, so let's forget it.
steps/base.py
Outdated
self.fit(*args, **kwargs) | ||
return self.transform(*args, **kwargs) | ||
|
||
def load(self, filepath): | ||
"""Saves the trainable parameters of the transformer |
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.
Loads
steps/base.py
Outdated
kwargs: keyword arguments (can be anything) | ||
|
||
Returns: | ||
obj: BaseTransformer instance |
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.
Returns:
BaseTransformer: self object
steps/utils.py
Outdated
It creates logger of name 'steps' | ||
|
||
Returns: | ||
obj: logging.Logger object |
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.
Returns:
logging.Logger: logger object
steps/base.py
Outdated
Args: | ||
name (str): name of the step to be fetched | ||
Returns: | ||
obj: Step instance |
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.
Returns:
Step: extracted step
steps/utils.py
Outdated
|
||
Returns: | ||
obj: logging.Logger object of name 'steps' |
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.
Returns:
logging.Logger: logger object
steps/base.py
Outdated
kwargs: keyword arguments (can be anything) | ||
|
||
Returns: | ||
obj: BaseTransformer instance |
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.
it returns a dictionary with results, not a BaseTransformer instance
transformer (obj): Step instance or object that inherits from BaseTransformer. | ||
When Step instance is passed transformer from that Step will be copied and used to perform transformations. | ||
It is useful when both train and valid data are passed in one pipeline (common situation in deep learnining). | ||
input_steps (list): list of Step instances default []. Current step will combine outputs from input_steps and input_data |
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 changed the default to None on one of the branches
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.
@grzes314 can I change it to None leaving everything else as is ?
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 second thought, it might be cleaner to change such things after merge. Current comment is consistent with code on this branch.
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
* initial * cleaned up * updates keras models and callbacks * added explanation notebook * renamed notebook * ran notebook * transformer loading now to be clicked * dropped nlp * fixed typos * updated whats missing * updated with dsb and talking data * added simple pipeline notebook * imports optimized * feature_names=None and categorical_features=None * refactor the way the model parameters are passed * moved adapters to seperate file, renamed identity/take_first adapters * Update misc.py * fit_transform -> transform * Update base.py * fixed #10 * fixed typo * * added: get_upsample_pad, get_downsample_pad * added: multiclass_segmentation_loss * *warning added * Add some user interface messages * Notebook#3: Adapter for ensembling * Add example: 1-getting-started.ipynb * Remove custom adapter; other minor changes after reviewer feedback * Add example 2-multi-step.ipynb and some minor changes to example 1-getting-started.ipynb * Cleanup of examples 1 and 2 * Fix a mistake in notebook text * Add steps/__pycache__ to .gitignore * Further changes based on Github feedback * add self.conv_stride parameter in unet definition * Change steps/__pycache__ to *.pyc in .gitignore * Changes in Notebook#3 following code review * train forests on train data and ensembler on ensembling data * decoupled sklearn preprocessing from text preprocessing with heavy de… (#32) * decoupled sklearn preprocessing from text preprocessing with heavy dependencies * fixed import error * dropped anonymization from text.py, reformatted imports, small refactors * small refactor for readability * Change time format (#40) * Dev docstrings (#33) * Step halfway done * Step init args done * Steps docstrings done * added docstrings to Step properties * Step docstring done * dropped mock transformer addeed docstrings to Base and Dummy Transformers * base documentation finished, minor refactors * docstrings added to adapters * docstrings added * started refactoring lgbm * Update base.py * updated docstrings * base transformer docstring fix * fixed logging docstrings * Notebook #5: Example with Keras (#41) * Notebook #5: Example with Keras * Corrected notebook for Keras and necessary refactors in ClassifierGenerator * Fix issue #28: Unintuitive adapter syntax (#42) * Write tests for new adapter syntax * Refactor adapter * Improve handling of caches and logs in tests * Fix minor issues mentioned in PR comments * Rewrite tests in pytest framework * Move adapting to seperate class, alter behaviour * Correction: mutable object as default argument in Step initializer * Issue #16: make_transformer (#50) * Corrections and tests for Sklearn wrappers * make_transformer taking arbitrary functions * fix issues #48 and #49 (#52) * fix issues #48 and #49 * use of setdefault method * fix according to Kamil's request * Fix post merge issues * Prepare package (#58) * Remove tutorial notebooks * Remove modules with heavy dependencies * Rename steps -> steppy * Add setup.py * Tell git to ignore egg files * Read the docs might output of sphinx-quickstart * Requirements file * Try adding sphinx-apidoc output * Add some requirements * Add IPython to requirements * removed intro.ipynb and updated requirements.txt * corrected setup.py * refactored NoOperation to IdentityOperation, optimized inputs * moved misc.py to steppy-toolkit * simplified ProbabilityCalibation, BaseTransformer small refactor * prepare setup.py and setup.cfg for PyPI registration * added install requires to setup.py * name refactor * Create README.md
No description provided.