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

TypeError: an integer is required #67

Open
Kein0112 opened this issue Oct 17, 2017 · 11 comments
Open

TypeError: an integer is required #67

Kein0112 opened this issue Oct 17, 2017 · 11 comments

Comments

@Kein0112
Copy link

Kein0112 commented Oct 17, 2017

  • PymRMR version: 0.1.8
  • Python version:3.5.2
  • Operating System: Windows 10

Description

I'm trying to run the below

n=10
pymrmr.mRMR(df.iloc[:, 1:], 'MIQ', n)

However, the error occurs as following.

TypeError: an integer is required

What I Did

I'm searching the solution for the error but there is the solution working in Cython.
And, I have no knowledge on Cython. Also, I tried to add a code pymrmr.pyx but it didn't work

@fbrundu
Copy link
Owner

fbrundu commented Oct 17, 2017

Hi @Kein0112,
Could you provide me a test matrix that generates such error so I can debug it?
Thanks,
Francesco

@shm-smn
Copy link

shm-smn commented Jun 5, 2018

Did you find the solution for that? as i am encountering the same problem.

@fbrundu
Copy link
Owner

fbrundu commented Jun 6, 2018

@shm-smn could you share a test matrix to understand the issue?

Thanks

@Irving-ren
Copy link

@fbrundu I just occurred the same problem. Do you familiar with this problem?

@fbrundu
Copy link
Owner

fbrundu commented Jul 31, 2018

@terminator9487 could you share some test data to understand the issue?

Thanks

@Irving-ren
Copy link

Of course, Could I have you email address?

@fbrundu
Copy link
Owner

fbrundu commented Aug 2, 2018

If it's not private you can just drop it here. Can you anonymize it?

@AlvaroRodriguezDelRio
Copy link

Hi! I am experiencing the same problem when inputing this matrix (which is a subset of a larger one for which I get the same error):

disease g1 g2 g3
CTR 0.000482 0.0 0.0
CRC 0.003343 0.0 0.0
CRC 0.006969 0.0 0.0
CTR 0.000000 0.0 0.0

Any idea of what the problem could be? Thanks in advanced!

@noobyogi0010
Copy link

noobyogi0010 commented Dec 12, 2019

Hi @AlvaroRodriguezDelRio !
I looked at the error and got to know that it is caused by the file pymrmr.pyx
Upon more debugging I found that it's because in the source file pymrmr.pyx where the mRMR function is defined, there's a line as follows:

  1. def mRMR(data, method, nfeats):
  2. cdef vector[vector[int]] _data = data.copy().values

In the line 2, you can see that the values of the input data, that's, the actual CSV file is copied into a int cell of the 2d vector. On the other hand, the data file you input contains values in float format, due to which it is giving the TypeError.
I'll create a pull request after making the appropriate changes to the pymrmr.pyx file.
I hope this might help you.
Thanks

@AlvaroRodriguezDelRio
Copy link

Thanks a lot for your answer @noobyogi0010 ! This was really helpful, I will be looking forward to the new updated version with the changes you propose!

@Melodddy
Copy link

@noobyogi0010你好,能详细说说你是怎么改的吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants