mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gabeweb <>
Subject TreeClusteringRecommender, clustering, and multiple processors
Date Fri, 17 Sep 2010 05:49:12 GMT

(Sorry for reposting, posted this first to Mahout top-level list instead of
user or development)

I just discovered that TreeClusteringRecommender is performing the
clustering once for each processor on my computer.  This is because the
constructor doesn't build the clusters, so they aren't actually built until
the evaluation of the test items begin -- but the test item evaluation is
divided among my multiple processors.  Each one of the test item evaluation
threads discovers that the clusters haven't been built yet, so each thread
performs the clustering independently.

I think the solution to this problem is to add a call to buildClusters() as
the last line of the constructor -- this is similar to what e.g.
SVDRecommender does.  That way, the clustering is performed when the
recommender is instantiated, and then during testing each thread discovers
that the clusters have already been built, so they don't do the clustering
themselves (four times).  Does this sound like a reasonable thing to do?  It
seems to work for me.  Thanks. 
View this message in context:
Sent from the Mahout User List mailing list archive at

View raw message