Rambatino / CHAID

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

Added ordinal variable type to independent variables #45

Closed xulaus closed 7 years ago

Rambatino commented 7 years ago

Hmm it appears we have a numpy sorting issue in python3: ar.sort()

        if optional_indices:
            perm = ar.argsort(kind='mergesort' if return_index else 'quicksort')
            aux = ar[perm]
        else:
>           ar.sort()
E           TypeError: unorderable types: NoneType() > float()

/usr/local/lib/python3.5/site-packages/numpy/lib/arraysetops.py:198: TypeError
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /usr/local/lib/python3.5/site-packages/numpy/lib/arraysetops.py(198)unique()
-> ar.sort()
(Pdb) ar.sort()
*** TypeError: unorderable types: NoneType() > float()
(Pdb) ar
array([1.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 5.0, 10.0, None], dtype=object)

And here's a discussion on numpy:

https://github.com/numpy/numpy/issues/641

Rambatino commented 7 years ago

@xulaus argh dealing with this again in python 3. So weird when I went on the numpy issues, found this issue and then my CHAID was linked in it! numpy/numpy#641