-
Notifications
You must be signed in to change notification settings - Fork 35
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
Issue 58 intermediate outputs #85
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #85 +/- ##
==========================================
+ Coverage 51.53% 69.5% +17.97%
==========================================
Files 5 5
Lines 423 469 +46
==========================================
+ Hits 218 326 +108
+ Misses 205 143 -62
Continue to review full report at Codecov.
|
ManuelAlvarezC
approved these changes
May 9, 2019
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolve #58 and #61
Allow getting intermediate outputs and allow fitting or producing only half of the pipeline.
Also update the documentation to match the changes from the latest MLPrimitives versions.
The implementation has been done as follows:
output_
andstart_
have been added toMLPipeline
fit
andpredict
methods.output_
argument can be either anint
or astr
, and encodes ablock_name
and avariable_name
within it:int
, it is interpreted as the block index, and the method call will return the context right after the indicated block's produce method has been called. As all indices in python, 0 is the first one. Also, negative values work, so -1 is the last block. Indices that are either too big or too small raise anIndexError
.str
, it is expected to be the name of a block, including the counter number at the end:name.of.the.primitive#n
. In this case, the method call will return the context right after the indicated block's produce method has been called. Optionally, a variable name can be added at the end, using a'.'
as separator:name.of.the.primitive#n.variable_name
. In this case, instead of returning all the context, the corresponding variable will be extracted from it. If the block name does not match a block exactly, or if the indicated variable cannot be found in the context, a Value error is raised.start_
argument can be either anint
or anstr
, and it is interpreted as either the index or the name of a block. If given, the execution of the pipeline will start on that block, and all the blocks before that will be skipped. If andint
is given and the index is too big or to small, anIndexError
will be raised. If anstr
is given and it does not match the name of a block exactly, aValueError
will be raised.As a consequence of this development, several new possibilities arise:
Issue #58: Getting Intermediate Outputs
Once the pipeline has been fit, we can obtain an intermediate output by specifying the name or the index which we want to get the output from:
If we only need one of the variables, we can get it by specifying the block name and the variable name
Partial predict outputs can also be obtained during the fit process:
Issue #61: Partial re-fit
By using the previous feature, we can capture the status of the context after a certain block, and then use the
start_
argument to fit and produce the rest of the pipeline multiple times:And we can even set new hyperparameters between calls: