acba/elm

python 3.4 issue

Opened this issue · 6 comments

I have found a couple of error running the example on a python 3.4 platform.

The main difference is that in python 2.7 dictionary.values() gives a list, instead in 3.4 it is returning a view

So I found out that for fix this issue you have to modify:
-api.py file line 205 -> solution = operator.itemgetter(index)(list(f.call_log.keys()))._asdict()
-cma.py file line 82 -> solution = self.centroid = numpy.array(list(centroid))

Can you fix this error please and better check the python 3.x compatibility ??

Best regards,
Sandro

I have also encountered the same problem while running this script with the Python 3.5, resulting in the following error:

File "/usr/lib/python3.5/site-packages/elm/elmk.py", line 489, in search_param
param_kernel=param_ranges[1])
File "/usr/lib/python3.5/site-packages/optunity/api.py", line 212, in minimize
pmap=pmap)
File "/usr/lib/python3.5/site-packages/optunity/api.py", line 245, in optimize
solution, report = solver.optimize(f, maximize, pmap=pmap)
File "/usr/lib/python3.5/site-packages/optunity/solvers/CMAES.py", line 139, in optimize
sigma=self.sigma)
File "/usr/lib/python3.5/site-packages/deap/cma.py", line 84, in init
self.dim = len(self.centroid)
TypeError: len() of unsized object

Even the provided tests crash with the same error. Unfortunately, I think that the developer is not supporting this script anymore, which is a shame.

Hi. I've opened an issue for the kmaknicki error, before reading your item.
Unfortunately I'm a newby of python and I'm not able to fix it by my own.
Let me know if you have fixes... or can you suggest any other elm module (working with python 3.x.x= as well?

Hello. You can, as for now, use the other Python ELM module which I have adjusted to work under Python 3: https://github.com/kmachnicki/Python-ELM

Hi Kamil.

Thanks a lot. Do you have any suggestion about a primer introduction to the libs?

Roberto

Da: Kamil Machnicki [mailto:notifications@github.com]
Inviato: lunedì 15 agosto 2016 22.46
A: acba/elm elm@noreply.github.com
Cc: roberto brunialti roberto.brunialti@knowcastle.com; Comment comment@noreply.github.com
Oggetto: Re: [acba/elm] python 3.4 issue (#1)

Hello. You can, as for now, use the other Python ELM module which I have adjusted to work under Python 3: https://github.com/kmachnicki/Python-ELM


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #1 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/ABgAbIhnsvEAgK1IvfwKDVOb-IdO4Ma4ks5qgNASgaJpZM4F6vK6 . https://github.com/notifications/beacon/ABgAbFbe5fvIN2JQDjZRlytHly2Fpkc1ks5qgNASgaJpZM4F6vK6.gif

Nessun virus nel messaggio.
Controllato da AVG - www.avg.com http://www.avg.com
Versione: 2016.0.7752 / Database dei virus: 4647/12817 - Data di rilascio: 16/08/2016

All documentation about the specific lib is always located with its source, and if not, you can always read the source code to check what exactly every class or function is responsible of and what parameters it expects. Tests (if any) along with the code are also a great way to check how to use the lib.

Hi @kmachnicki
Can you provide an example implementing your ELM library? This will be much helpful for me as I am new in machine learning using python. How can I load a dataset using your library?