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] #133

Open
wal-iston opened this issue Jun 20, 2024 · 4 comments
Open

[BUG] #133

wal-iston opened this issue Jun 20, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@wal-iston
Copy link

wal-iston commented Jun 20, 2024

Hi, I don't know if it is a bug.

I am using:
extractor = pymfe.mfe.MFE(features=['f1'], groups=['complexity'], summary=['max']) extractor.fit(np.array(X), y.numpy().astype('int64'))
X is a tensor with dimension (100, 1176).
y is a tensor with dimension (100,).


Do you know why am I receiving the following warnings?

/home/user/miniconda3/envs/complexity/lib/python3.8/site-packages/pymfe/_internal.py:1568: UserWarning: It is not possible make equal discretization
warnings.warn("It is not possible make equal discretization")
/home/user/miniconda3/envs/complexity/lib/python3.8/site-packages/pymfe/complexity.py:804: RuntimeWarning: invalid value encountered in true_divide
attr_discriminant_ratio = _numer / _denom
/home/user/miniconda3/envs/complexity/lib/python3.8/site-packages/pymfe/_internal.py:731: RuntimeWarning: Can't summarize feature 'f1' with summary 'max'. Will set it as 'np.nan'.
warnings.warn(

@wal-iston wal-iston added the bug Something isn't working label Jun 20, 2024
@FelSiq
Copy link
Collaborator

FelSiq commented Jun 20, 2024

It appears that for some features in X the f1 measure is undefined (NaN).

You can use summary=["nanmax"] to ignore the problematic features and compute the maximum among the valid values.

Those warnings, however, hint that something may be off with some features in X. I suggest you to analyze it considering the definition of the f1 measure.

Felipe.

@wal-iston
Copy link
Author

wal-iston commented Jun 20, 2024

Hi, thank you.

What does it mean? " hint that something may be off with some features in X "


X has no nan value. Look:

In [54]: np.isnan(X).any() Out[54]: False
The same happens to y.


I tried summary=["nanmax"] , but unfortunately I receive the result:

home/user/miniconda3/envs/complexity/lib/python3.8/site-packages/pymfe/_internal.py:1568: UserWarning: It is not possible make equal discretization warnings.warn("It is not possible make equal discretization") /home/user/miniconda3/envs/complexity/lib/python3.8/site-packages/pymfe/complexity.py:804: RuntimeWarning: invalid value encountered in true_divide attr_discriminant_ratio = _numer / _denom /home/user/miniconda3/envs/complexity/lib/python3.8/site-packages/pymfe/_internal.py:1568: UserWarning: It is not possible make equal discretization warnings.warn("It is not possible make equal discretization") /home/user/miniconda3/envs/complexity/lib/python3.8/site-packages/pymfe/complexity.py:804: RuntimeWarning: invalid value encountered in true_divide attr_discriminant_ratio = _numer / _denom /home/user/miniconda3/envs/complexity/lib/python3.8/site-packages/pymfe/_internal.py:1568: UserWarning: It is not possible make equal discretization warnings.warn("It is not possible make equal discretization")

@FelSiq
Copy link
Collaborator

FelSiq commented Jun 22, 2024

I can't track the cause of those warnings without access to the data.

Can you use any other dataset to check if the issue persists?

@wal-iston
Copy link
Author

Indeed, it don't persist with the data from the examples in https://github.com/ealcobaca/pymfe

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