You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Arshad Khan <kh...@gmail.com> on 2010/04/01 03:19:53 UTC

Re: Empty cluster exception

The parameters passed to KMeansDriver are as follows:

K = 4
Measure Class = CosineDistanceMeasure
Convergence Delta = 0.001
Max Iterations = 20
No. of Reduce Tasks = 1

The way I use KMeansDriver is by calling the runJob method in my application
passing in above parameters. The initial clusters are generated by calling
the RandomSeedGenerator.buildRandom method.

The error does not happen everytime; it appears randomly. I noticed that it
does not happen when I run the clustering on the data the very first time.
On subsequent runs on the same data it happens. Also its seems to occur if
data size is small, e.g 50 points.

Arshad



On Wed, Mar 31, 2010 at 9:29 PM, Grant Ingersoll <gs...@apache.org>wrote:

> Can you share the parameters you used to get this?  Does it happen every
> time?
>
>
> On Mar 29, 2010, at 11:53 PM, Arshad Khan wrote:
>
> > Hello All
> >
> > While using Mahout 0.3 KMeansDriver I am encountering an exception
> > indicating an empty cluster. This happens sometimes while re-running the
> > clustering on the same data set. Is there a way to prevent this error?
> The
> > exception trace is follows:
> >
> > java.lang.RuntimeException: Error in configuring object
> >        at
> >
> org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:93)
> >        at
> > org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:64)
> >        at
> >
> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)
> >        at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:354)
> >        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:307)
> >        at
> > org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:176)
> > Caused by: java.lang.reflect.InvocationTargetException
> >        at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
> >        at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >        at java.lang.reflect.Method.invoke(Method.java:597)
> >        at
> >
> org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:88)
> >        ... 5 more
> > Caused by: java.lang.RuntimeException: Error in configuring object
> >        at
> >
> org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:93)
> >        at
> > org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:64)
> >        at
> >
> org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)
> >        at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:34)
> >        ... 9 more
> > Caused by: java.lang.reflect.InvocationTargetException
> >        at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
> >        at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >        at java.lang.reflect.Method.invoke(Method.java:597)
> >        at
> >
> org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:88)
> >        ... 12 more
> > Caused by: java.lang.IllegalStateException: Cluster is empty!
> >        at
> >
> org.apache.mahout.clustering.kmeans.KMeansClusterMapper.configure(KMeansClusterMapper.java:73)
> >        ... 16 more
> >
> > Thanks
> > Arshad
>
> --------------------------
> Grant Ingersoll
> http://www.lucidimagination.com/
>
> Search the Lucene ecosystem using Solr/Lucene:
> http://www.lucidimagination.com/search
>
>