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

Solution contains target Y labels. #3

Open
sheng-di opened this issue Feb 19, 2021 · 3 comments
Open

Solution contains target Y labels. #3

sheng-di opened this issue Feb 19, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@sheng-di
Copy link

Example code:

from pymrmre import mrmr
import numpy as np
import pandas as pd

data_X = np.random.random((10, 7))
data_Y = np.random.random_integers(0, 1, (10, 1))
print(data_Y)
X = pd.DataFrame(data=data_X, columns=[f'f{i}' for i in range(7)])
Y = pd.DataFrame(data=data_Y, columns=['label'])
fixed_features = ['f6']
category_features = [f'f{i}' for i in range(6)]

solutions = mrmr.mrmr_ensemble(features=X, targets=Y, fixed_features=fixed_features,
                               category_features=category_features,
                               solution_length=4, solution_count=3)

However, there are Y labels in solutions, which is incorrect:

('label', [['f6', 'label', 'label', 'label'], ['f6', 'label', 'label', 'label'], ['f6', 'label', 'label', 'label']])
@ChristopherEeles
Copy link
Contributor

Hi @378978764,

I am going to look into both your issues, but the C++ developer who wrote the code is no longer with our organization and I am not a C++ expert. So it may take some time.

I will keep you updated.

Best,
Christopher Eeles

@ChristopherEeles
Copy link
Contributor

Can you confirm the version of pymrmre you are using with pip freeze please?

@ChristopherEeles
Copy link
Contributor

ChristopherEeles commented Feb 20, 2021

Hi @378978764,

I have determined that the target column name only shows up in the features when len(fixed_features) + len(categorical_features) == X.shape[1].

As I suspected, the issue is occurring in the package C++ internals. I will need to ask my colleagues for help debugging that code.

For now, I am going to throw an error in the Python code when that case occurs. Look for version 1.0.6 for this fix.

Best,
Chris

@ChristopherEeles ChristopherEeles added the bug Something isn't working label Apr 1, 2021
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