Ok, so the Solution to this was fairly simple actually. I imported sklearn.cluster as cluster, which seems to have fixed the problem. So now the code reads:
estimator = cluster.KMeans(n_clusters=k,init="k-means++") estimator[:fit](dataTable) On Wednesday, October 22, 2014 11:28:54 PM UTC-4, Vera Abaimova wrote: > > Hi, I'm trying to run a k-means clustering algorithm on my data using the > sklearn package. I'm using Julia so I'm using PyCall in order to have > access to all the sklearn functions. When I run my k-means I'm getting an > output of "cluster not defined". Any ideas on how to fix this? > > estimator = sklearn.cluster.KMeans(n_clusters=k,init="k-means++") > estimator[:fit](dataTable) > > Output in IJulia: > In [54]: > > evaluateVariousK() > > cluster not defined > while loading In[54], in expression starting on line 1 > > >
