aws / sagemaker-scikit-learn-extension

A library of additional estimators and SageMaker tools based on scikit-learn
Apache License 2.0
39 stars 33 forks source link

fix: adds np.random.seed(0) to test_preprocessing.py to ensure determ… #2

Closed ipanepen closed 4 years ago

ipanepen commented 4 years ago

…inistic behavior

Description of changes: test_log_extreme_value_transformer uses numpy arrays generated by np.random. The array 5 * np.random.random((100, 1)) + 20 is not supposed to have extreme values as defined by LogExtremeValuesTransformer(threshold_std=2.0). However, the use of np.random makes this test indeterministic. For example, with np.seed(69) the array has extreme values and the test fails. The addition of np.random.seed(0) ensures deterministic behavior in this test.

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

wiltonwu commented 4 years ago

AWS CodeBuild CI Report

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository