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

Issue with Error message stating inputs are of wrong sizes #48

Open
swzCuroverse opened this issue May 9, 2018 · 7 comments
Open

Issue with Error message stating inputs are of wrong sizes #48

swzCuroverse opened this issue May 9, 2018 · 7 comments

Comments

@swzCuroverse
Copy link

I am getting the following error, my inputs are of the correct input size. I am not sure where to contact the authors for assistance so writing this up as an issue. Xtrain is all ones and zeros (it comes from a 1hot encoder) and y is all ones and zeros. Example code given in documentation works fine so not an install issue.

I used the following code (I am running on a 16 core machine):
fs = ReliefF(n_features_to_select=2000, n_neighbors=100,n_jobs=-1)
fs.fit(Xtrain, y)

Shapes for additional info:

y.shape
(3672,)
Xtrain.shape
(3672, 1688789)

Error message:
Traceback (most recent call last):
File "reliefChr19.py", line 180, in
fs.fit(Xtrain, y)
File "/usr/local/lib/python2.7/dist-packages/skrebate/relieff.py", line 154, in fit
self.attr = self._get_attribute_info() #Examines each feature and applies discrete_threshold to determine variable type.
File "/usr/local/lib/python2.7/dist-packages/skrebate/relieff.py", line 280, in _get_attribute_info
zlen = len(np.unique(z))
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/arraysetops.py", line 210, in unique
return _unique1d(ar, return_index, return_inverse, return_counts)
File "/usr/local/lib/python2.7/dist-packages/numpy/lib/arraysetops.py", line 279, in _unique1d
flag = np.concatenate(([True], aux[1:] != aux[:-1]))
ValueError: all the input arrays must have same number of dimensions

@ryanurbs
Copy link
Member

were you able to figure out this issue?

@swzCuroverse
Copy link
Author

No, I have not. However, I know have a set of data that we can use that is public so I can give it to you for debugging purposes. I will write up a script in the next few days if that is useful?

@weixuanfu
Copy link
Contributor

A script for reproducing this issue is helpful. Thank you!

One questions, what is type(Xtrain) in your codes?

@ryanurbs
Copy link
Member

Yeah i'm just trying to figure out if there is a bug that needs to be fixed or if there might be a user error issue. Last night we just released a new version with a number of updates/fixes. So perhaps that alone might resolve your issue.

@swzCuroverse
Copy link
Author

Ok, I will update the version and try again.

@swzCuroverse
Copy link
Author

Xtrain was a sparse that I made using the 1-hot encoding in sci-kit learn that I convert to dense using Xtrain = Xtrain.todense(),

@swzCuroverse
Copy link
Author

I updated and it seems to be chugging away with no error, so a good sign!

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

3 participants