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

[BUG] User-Specified Threshold for CollinearityThreshold is not Applied. #33

Closed
zdanaceau opened this issue Sep 13, 2023 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@zdanaceau
Copy link

zdanaceau commented Sep 13, 2023

Hey, I was looking through the code for ColinearityThreshold for a similar method I've been putting together and I noticed that in _recursive_collinear_elimination, the user specified collinearity threshold is not propagated into the while loop. I've highlighted the issue with my comment below:

def _recursive_collinear_elimination(association_matrix, threshold):
    dum = association_matrix.copy()
    most_collinear_features = []
    most_collinear_feature, to_drop = _most_collinear(association_matrix, threshold)
    most_collinear_features.append(most_collinear_feature)
    dum = dum.drop(columns=most_collinear_feature, index=most_collinear_feature)

    while len(to_drop) > 1:
        most_collinear_feature, to_drop = _most_collinear(dum, 0.75) # Should be threshold instead of 0.75
        most_collinear_features.append(most_collinear_feature)
        dum = dum.drop(columns=most_collinear_feature, index=most_collinear_feature)
    return most_collinear_features

Thanks for this fantastic package by the way.

@ThomasBury
Copy link
Owner

Hi @zdanaceau , thank you for the kind words and for pointing out the bug! I'll patch it asap

@ThomasBury ThomasBury self-assigned this Sep 21, 2023
@ThomasBury ThomasBury added the bug Something isn't working label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants