Enhance Outlier Detection Test Coverage and Edge Case Handling #474
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.
Issue: #473
Note: Add all the labels and Update it to the leaderboard SWOC leaderboard
This PR improves the test cases for the outlier detection functions (remove_outliers_iqr, remove_outliers_zscore) by adding additional checks and edge cases. The following updates have been
1. Single Outlier:
Tests were added to verify that a single outlier (e.g., 120000 in salary data) is correctly removed by both IQR and Z-score methods.
Checks the length of the DataFrame before and after outlier removal to ensure that only the outlier is
2. No Outliers Scenario:
3. Multiple Outliers:
A new test case was added to handle and verify the removal of multiple outliers from the dataset.
The function now ensures that all outliers are correctly identified and
4. Data Integrity Checks:
Benefits:
Increased test coverage for edge cases, ensuring robustness of the outlier detection
Improved validation of the correctness of the remove_outliers_iqr and remove_outliers_zscore functions under various data conditions.
Changes:
Testing: