[ 
https://issues.apache.org/jira/browse/MAHOUT-845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13133104#comment-13133104
 ] 

Jake Mannix commented on MAHOUT-845:
------------------------------------

Ooh, actually, I have code which does this on my github branch, in fact.  I 
keep saying that, I really need to merge it over.  So you have to be really 
careful with Vector.Element instances, as they are often "virtual" - the same 
object is reused over and over again if you iterate.  So you end up getting 
very strange/wrong results if you try to hang onto them.

But I'll take a look at this patch, I agree this functionality is totally 
needed (I needed it badly enough I just hacked it into my code) for vectors in 
general (have to be careful of negative values though!).
                
> Make cluster top terms code more reusable
> -----------------------------------------
>
>                 Key: MAHOUT-845
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-845
>             Project: Mahout
>          Issue Type: Improvement
>          Components: Clustering
>    Affects Versions: 0.5
>            Reporter: Frank Scholten
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: MAHOUT-845.patch
>
>
> When working with Mahout text clustering I find that I keep writing code 
> similar to the contents of
> public static String getTopFeatures(Cluster cluster, String[] dictionary, int 
> numTerms)
> in ClusterDumper in order to determine cluster labels.
> I think it would be useful if (parts of) this code are added to the cluster 
> or vector API so that you could do something like
> Cluster cluster = ... // get the cluster from seq file iterable
> String clusterLabel = cluster.getTopTerms(1, dictionary); // Do something 
> with the label  
> I think this would make it easier to export and post-process clustering 
> results, like indexing or storing them elsewhere.
> Thoughts?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to