Hi,

You have to use SequenceFileReader.Reader for this. Read the file  output /
Cluter.CLUSTERED_POINTS_DIR / part-m-00000.

you can read like this.
IntWritable key = new IntWritable();
WeightedVectorWritable value = new WeightedVectorWritable();
while(reader.next(key,value) {
  print(value.toString() +" is in cluster " + key.toString() );
}

Hope it is clear.

-Abin

On Mon, Dec 26, 2011 at 11:45 AM, petar.mitrovic [via Lucene] <
[email protected]> wrote:

> Hi everyone,
>
> I have succeeded in creating clusters for my data set containing 1000
> articles using k-means algorithm. I can perform cluster dump and explore
> most significant terms defining a cluster.
>
> I can also iterate through the clustered points sequence file and print
> out the data.
>
> Now, I am stuck with a basic problem - how can I determine which cluster
> an item belongs to? Let's say you have the item with the id 100 and you
> need to print out the cluster(s) it belongs to. Also, I would like to print
> out all other item ids from the same cluster eventually, if it is possible.
>
> Regards,
> Petar
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://lucene.472066.n3.nabble.com/How-to-determine-which-cluster-an-item-belongs-to-tp3613013p3613013.html
>  To start a new topic under Mahout User List, email
> [email protected]
> To unsubscribe from Mahout User List, click 
> here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=639155&code=bWFpbDJhYmluQGdtYWlsLmNvbXw2MzkxNTV8LTk4NjE5MjkxOA==>
> .
> NAML<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


-----
Abin Varghese
Software Engineer
NY
--
View this message in context: 
http://lucene.472066.n3.nabble.com/How-to-determine-which-cluster-an-item-belongs-to-tp3613013p3613200.html
Sent from the Mahout User List mailing list archive at Nabble.com.

Reply via email to