hpelm icon indicating copy to clipboard operation
hpelm copied to clipboard

Weird error when 'OP' argument is set

Open freicaneca opened this issue 6 years ago • 1 comments

When calling ELM.train(data, labels, "CV", "OP", 'c', k=5) on the data and labels attached, I get the following error:

Traceback (most recent call last): File "parameter_analysis_elm.py", line 81, in elm.train(data, labels, "CV", 'OP', 'c', k=5) File "/usr/local/lib/python3.5/dist-packages/hpelm/elm.py", line 198, in train e = train_cv(self, X, T, k) File "/usr/local/lib/python3.5/dist-packages/hpelm/mss_cv.py", line 53, in train_cv rank, L = self._ranking(Hvl.shape[1], Hvl, Tvl) File "/usr/local/lib/python3.5/dist-packages/hpelm/elm.py", line 503, in _ranking rank = mrsr2(H, T, L) File "/usr/local/lib/python3.5/dist-packages/hpelm/modules/mrsr2.py", line 66, in mrsr2 nonrank.remove(j_current) AttributeError: 'range' object has no attribute 'remove'

I couldn't figure out how to solve it, unless by removing "OP" flag. The flag works for another data file, much smaller than this one.

data_and_labels.zip

freicaneca avatar Jan 03 '18 12:01 freicaneca

I've encountered the same problem actually. I've issued a pull request which seems to have fixed that. The problem is due to the fact that in Python 3 the range function don't return a list but a range type.

popcornell avatar Feb 08 '18 09:02 popcornell