commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Neidhart <thomas.neidh...@gmail.com>
Subject Re: Unable to use cluster function in DBSCANclusterer class
Date Fri, 26 Jul 2013 21:04:11 GMT
On 07/26/2013 09:54 PM, arvind viswanathan wrote:
> I am trying to use the class for clustering. However I am not sure about
> the syntax of using this function.
> Here is what I have,
> List<DoublePoint> data = new ArrayList<DoublePoint>();
> DBSCANClusterer<? extends Clusterable> dbscan = new
> DBSCANClusterer<DoublePoint>(10,3);
> List <Cluster<DoublePoint>> clusters = dbscan.cluster(data );
> 
> Above line gives an error,
> The method cluster(Collection<capture#1-of ? extends Clusterable>) in the
> type DBSCANClusterer<capture#1-of ? extends
>  Clusterable> is not applicable for the arguments (List<DoublePoint>)
> 
> 
> Not sure what I am doing wrong.

Hi Arvind,

I assume you use the refactored classes in the o.a.c.m.ml.clustering
package.

You can use the Clusterer like that:

  List<DoublePoint> data = new ArrayList<DoublePoint>();
  DBSCANClusterer<DoublePoint> dbscan =
         new DBSCANClusterer<DoublePoint>(10,3);
  List <Cluster<DoublePoint>> clusters = dbscan.cluster(data);

To use the generic interface Clusterable, the Clusterer interface should
better be like that:

 public List<Cluster<T>> cluster(final Collection<? extends T> points)

We will consider this for the next version.

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message