Skip to content

do not normalize datasets with too less entries#2

Open
mojoaxel wants to merge 1 commit intoyongjun21:masterfrom
mojoaxel:normalizeFix
Open

do not normalize datasets with too less entries#2
mojoaxel wants to merge 1 commit intoyongjun21:masterfrom
mojoaxel:normalizeFix

Conversation

@mojoaxel
Copy link
Copy Markdown
Contributor

It loess is called with an array less than 4 data-points and normalization is enabled an error occurs in https://github.com/yongjun21/loess/blob/master/src/helpers.js#L12 because math.std can not be called with an empty array. Also it makes no sense for arrays with less than 4 entries.

This fix returns the original array is it has too little entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant