rasbt / mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
https://rasbt.github.io/mlxtend/
Other
4.82k stars 853 forks source link

Feature range parameter support #1044

Open namanmistry opened 1 year ago

namanmistry commented 1 year ago

Description

As described in the issue Replace min_features and max_features in ExhaustiveFeatureSelector by feature_range and recipe #260 I have added support for new parameter feature_range in class ExhaustiveFeatureSelector. The priority of the parameters is still the same so it does not break the code base.

Related issues or pull requests

Fixes `Replace min_features and max_features in ExhaustiveFeatureSelector by feature_range and recipe #260 partially. still recipe parameter is remaining.

Pull Request Checklist

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 20.00% and project coverage change: -0.08 :warning:

Comparison is base (8ae4570) 77.27% compared to head (7d1a00c) 77.19%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1044 +/- ## ========================================== - Coverage 77.27% 77.19% -0.08% ========================================== Files 200 200 Lines 11308 11321 +13 Branches 1484 1487 +3 ========================================== + Hits 8738 8739 +1 - Misses 2351 2362 +11 - Partials 219 220 +1 ``` | [Impacted Files](https://app.codecov.io/gh/rasbt/mlxtend/pull/1044?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sebastian+Raschka) | Coverage Δ | | |---|---|---| | [...d/feature\_selection/exhaustive\_feature\_selector.py](https://app.codecov.io/gh/rasbt/mlxtend/pull/1044?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sebastian+Raschka#diff-bWx4dGVuZC9mZWF0dXJlX3NlbGVjdGlvbi9leGhhdXN0aXZlX2ZlYXR1cmVfc2VsZWN0b3IucHk=) | `70.58% <20.00%> (-4.70%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

rasbt commented 1 year ago

Thanks a lot for the PR! If you have time, could you add a few unit tests to make sure it works as intended?

namanmistry commented 1 year ago

Hello @rasbt, Actually I am very new to open source and this is the first repo that I am contributing to. So could you please elaborate on how to add unit tests and possibly share some resources? Thank you.

NimaSarajpoor commented 1 year ago

Hello @rasbt, Actually I am very new to open source and this is the first repo that I am contributing to. So could you please elaborate on how to add unit tests and possibly share some resources? Thank you.

I was just wandering and noticed your comment. You should add a test function in https://github.com/rasbt/mlxtend/blob/master/mlxtend/feature_selection/tests/test_exhaustive_feature_selector.py to test whether the new changes work properly or not. I suggest that you go and checkout some of the existing test functions in the provided link to get some idea. Then, you should start write a test function. It is not always straightforward and you need to think how to assert the outcome of the function when user provides input considering the changes you applied.

I think @rasbt can definitely explain better when he gets a chance to get back to you. In the meantime, you may just go through the test functions in the provided link to better understand how tests are written.