-
Notifications
You must be signed in to change notification settings - Fork 330
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
Disregard NaNs in TimeSeriesScalerMeanVariance #175
Conversation
MAINT Include test folder in wheels
MAINT More fixes to include test/ folder in sdist
Use np.nanmean and np.nanstd instead of np.mean and np.std
Codecov Report
@@ Coverage Diff @@
## dev #175 +/- ##
==========================================
- Coverage 93.97% 93.69% -0.29%
==========================================
Files 22 22
Lines 3039 2585 -454
==========================================
- Hits 2856 2422 -434
+ Misses 183 163 -20
Continue to review full report at Codecov.
|
Hi @eliwoods Thanks for the suggestion, this makes a lot of sense. I would suggest the following improvements:
Once all this is done, one last thing would be to document your contribution in |
Hello @eliwoods! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
If a time series with any
NaN
values is passed toTimeSeriesScalerMeanVariance.fit_transform()
the transformed time series returns as allNaN
E.g:
This could be fixed by using
numpy.nanmean()
andnumpy.nanstd()
inTimeSeriesScalerMeanVariance.transform
instead of the current implementation. This also makes tslearn in line with sklearn in terms of NaN's and preprocessing: scikit-learn/scikit-learn#10404