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

Enhance Outlier Detection Test Coverage and Edge Case Handling #474

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

smog-root
Copy link
Contributor

@smog-root smog-root commented Jan 5, 2025

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:

  • A test was added to handle cases where there are no outliers. It ensures that the DataFrame remains unchanged when no outliers are

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:

  • For each test, we validate the data integrity by ensuring that outliers are removed without affecting other data points.

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:

  • Added test_no_outliers to handle cases without any
  • Added test_multiple_outliers to check removal of multiple
  • Enhanced test_remove_outliers_iqr and test_remove_outliers_zscore to assert correct behavior and data integrity.

Testing:

  • All existing tests along with new ones have been executed successfully.

Copy link
Contributor

github-actions bot commented Jan 5, 2025

👋 Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly!

Feel free to join our community on Discord to discuss more!

@pavitraag
Copy link
Collaborator

@UTSAVS26 its good to go for merge

@UTSAVS26 UTSAVS26 merged commit 13718c9 into UTSAVS26:main Jan 7, 2025
1 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants