Rambatino / CHAID

A python implementation of the common CHAID algorithm
Apache License 2.0
149 stars 50 forks source link

Error while importing in Jupyter Notebook #108

Closed 1DanielG closed 4 years ago

1DanielG commented 4 years ago

I have installed last version of CHAID Package, when I am trying to import CHAID into my notebook . getting a syntax error

from CHAID import Tree

error message:

 File "C:\...\Local\Continuum\anaconda3\lib\site-packages\CHAID\graph.py", line 75
    file = 'C:\...\Documents\Python Scripts\CHAID\temp\' + ("%.20f" % time.time()).replace('.', '') + '.png'

    ^
SyntaxError: invalid syntax
Rambatino commented 4 years ago

Hi @1DanielG I've made a note to look into this in the next few hours.

Rambatino commented 4 years ago

Ahh I can see the error (line 75 of graph.py)

Current Version

https://github.com/Rambatino/CHAID/blob/master/CHAID/graph.py#L75

Old Version

https://github.com/Rambatino/CHAID/blob/f196f45a627bfd38610dbd8aa2c55edc9390aa0d/CHAID/graph.py#L75

You'll see in the most recent version that it doesn't use that method anymore. Thus your CHAID library isn't up to date.

Your most likely on version ~5.2.0, you'll need 5.3.0.

Rambatino commented 4 years ago

What is your output of pip freeze | findstr CHAID?

1DanielG commented 4 years ago

Yes! I had 5.2.1 . I upgraded it to 5.3.0. It works fine now . Thanks man

Rambatino commented 4 years ago

Amazing 🙌