Skip to content
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

refactor imputation transformation #907

Merged
merged 2 commits into from
Jul 3, 2020

Conversation

benidis
Copy link
Contributor

@benidis benidis commented Jul 3, 2020

Small refactoring of AddObservedValueIndicator transformation.

Removed unnecessary fields:

  • dummy_value: This is imputation-method-dependent and should not be an argument of the transformation. Instead the transformation should take as input the imputation method with this field set already.
  • convert_nans: This is unnecessary since we can just use None as imputation method.

With the above change we have control IF we want to do imputation or not in the transformation by including a hyperparameter in the estimator (setting it to the appropriate imputation method or to None). This gives the flexibility to select from a model-based imputation method (e.g. if set to None use a sample from the predictive distribution since the imputation from the transformation is disabled) or from a transformation based imputation (e.g. a dummy value).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

Codecov Report

Merging #907 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #907      +/-   ##
==========================================
- Coverage   85.80%   85.80%   -0.01%     
==========================================
  Files         195      195              
  Lines       11853    11851       -2     
==========================================
- Hits        10171    10169       -2     
  Misses       1682     1682              
Impacted Files Coverage Δ
src/gluonts/transform/feature.py 98.41% <100.00%> (-0.02%) ⬇️

@benidis benidis merged commit 5c2f4ce into awslabs:master Jul 3, 2020
@benidis benidis deleted the imputation_refactor branch July 3, 2020 11:48
@lostella lostella added the BREAKING This is a breaking change (one of pr required labels) label Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING This is a breaking change (one of pr required labels)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants