IBCNServices / GENDIS

Contains an implementation (sklearn API) of the algorithm proposed in "GENDIS: GEnetic DIscovery of Shapelets" and code to reproduce all experiments.
Other
102 stars 26 forks source link

GENDIS import problem #8

Closed mmar30 closed 5 years ago

mmar30 commented 5 years ago

Hi,

I have problems with importing modules from gendis, when I run this code I get the following error:

from gendis.genetic import GeneticExtractor
genetic_extractor = GeneticExtractor(population_size=50, iterations=25, verbose=False, 
                                     normed=False, add_noise_prob=0.3, add_shapelet_prob=0.3, 
                                     wait=10, plot='notebook', remove_shapelet_prob=0.3, 
                                     crossover_prob=0.66, n_jobs=4)

ERROR:

Traceback (most recent call last):
  File "/Users/maria/PycharmProjects/gendis_new/main.py", line 1, in <module>
    from gendis.genetic import GeneticExtractor
  File "/Users/maria/PycharmProjects/gendis_new/gendis/genetic.py", line 35, in <module>
    from gendis.pairwise_dist import _pdist
ImportError: No module named 'gendis.pairwise_dist'

Process finished with exit code 1

I’ve installed gendis sucessfully with Python 3.5. OS: Mojave 10.14.3

GillesVandewiele commented 5 years ago

Hello @mmar30

There indeed seems to be a problem with the latest release (I will try to fix this asap). Did you install in through pip or by cloning and running setup?

Another option would be to install a older (but slower) version of gendis:

`pip install gendis==1.0.91

mmar30 commented 5 years ago

Thank you! I installed it by cloning and running setup. Now I've tried to run the script with gendis 1.0.91, but I still get the same error.

GillesVandewiele commented 5 years ago

Sorry, I made a typo there. It should have been pip install gendis==1.0.9

(and remove the GENDIS directory from your PycharmProject). It should be noted that this version will be 10x slower...

Another option would be to fix the imports in the genetic.py manually.

mmar30 commented 5 years ago

Now it works with gendis 1.0.9. Thank you :)

GillesVandewiele commented 5 years ago

I think I made a fix for the import problems today, @mmar30 can you try to install pip install gendis==1.0.12 to see if it works? That version should be much faster since the bottleneck is written in Cython.

May I ask what you are using shapelets for by the way? And have you tried any other extraction techniques than GENDIS?

mmar30 commented 5 years ago

This works too, thanks! I'm comparing different libraries for analysing gait patterns with shapelets.

GillesVandewiele commented 5 years ago

Cool! I would be very interested in that comparison ;) are there any preliminary results yet?

mmar30 commented 5 years ago

Not yet, but I can tell you when I have some :)

GillesVandewiele commented 5 years ago

Would be greatly appreciated. Thanks!