luispedro / milk

MILK: Machine Learning Toolkit
http://www.luispedro.org/software/milk
MIT License
605 stars 146 forks source link

Import milk shows : SystemError: initialization of _kmeans failed without raising an exception #24

Open epratheeban opened 8 years ago

epratheeban commented 8 years ago

I installed milk and imported in Ipyhton by import milk. It says the below system error.

In [1]: import milk
---------------------------------------------------------------------------
SystemError                               Traceback (most recent call last)
<ipython-input-1-2c1431d8c8f7> in <module>()
----> 1 import milk

/Users/elancheliyan/anaconda/lib/python3.5/site-packages/milk/__init__.py in <module>()
     55
     56 try:
---> 57     from .nfoldcrossvalidation import nfoldcrossvalidation
     58     from .supervised.defaultclassifier import defaultclassifier
     59     from .supervised.defaultlearner import defaultlearner

/Users/elancheliyan/anaconda/lib/python3.5/site-packages/milk/nfoldcrossvalidation.py in <module>()
----> 1 from .measures.nfoldcrossvalidation import foldgenerator, getfold, nfoldcrossvalidation

/Users/elancheliyan/anaconda/lib/python3.5/site-packages/milk/measures/nfoldcrossvalidation.py in <module>()
      5
      6 from __future__ import division
----> 7 from ..supervised.classifier import normaliselabels
      8 import numpy as np
      9 from functools import reduce

/Users/elancheliyan/anaconda/lib/python3.5/site-packages/milk/supervised/__init__.py in <module>()
     51
     52 from .defaultclassifier import defaultclassifier, svm_simple
---> 53 from .classifier import normaliselabels
     54 from .gridsearch import gridsearch
     55 from .tree import tree_learner

/Users/elancheliyan/anaconda/lib/python3.5/site-packages/milk/supervised/classifier.py in <module>()
     23 from __future__ import division
     24 import numpy as np
---> 25 from .normalise import normaliselabels
     26 from .base import supervised_model
     27

/Users/elancheliyan/anaconda/lib/python3.5/site-packages/milk/supervised/normalise.py in <module>()
      8 import numpy as np
      9 from .base import supervised_model
---> 10 from ..unsupervised.normalise import zscore
     11
     12 __all__ = [

/Users/elancheliyan/anaconda/lib/python3.5/site-packages/milk/unsupervised/__init__.py in <module>()
     16 '''
     17
---> 18 from .kmeans import kmeans,repeated_kmeans, select_best_kmeans
     19 from .gaussianmixture import *
     20 from .pca import pca, mds, mds_dists

/Users/elancheliyan/anaconda/lib/python3.5/site-packages/milk/unsupervised/kmeans.py in <module>()
     25 from numpy import linalg
     26
---> 27 from . import _kmeans
     28 from ..utils import get_pyrandom
     29 from .normalise import zscore

SystemError: initialization of _kmeans failed without raising an exception

I found milk will be helpful in case to do K means clustering with mahalanobis distance instead of euclidean distance. can you please tell me how to rectify this error.

sheep0704 commented 6 years ago

show-> _kmeans.cpp