public List<Cluster<T>> cluster(final Collection<T> points) throws NullArgumentException {
  MathUtils.checkNotNull(points);
  final List<Cluster<T>> clusters=new ArrayList<Cluster<T>>();
  final List<Cluster<T>> anomalousClusters=new ArrayList<Cluster<T>>();
  final Cluster<T> anomalyCluster=new Cluster<T>();
  final Map<Clusterable,PointStatus> visited=new HashMap<Clusterable,PointStatus>();
  for (  final T point : points) {
    if (visited.get(point) != null) {
      continue;
    }
    final List<T> neighbors=getNeighbors(point,points);
    if (neighbors.size() >= minPts) {
      final Cluster<T> cluster=new Cluster<T>();
      clusters.add(expandCluster(cluster,point,neighbors,points,visited));
    }
 else {
      visited.put(point,PointStatus.NOISE);
      anomalyCluster.addPoint(point);
    }
  }
  anomalousClusters.add(anomalyCluster);
  return anomalousClusters;
}

public List < Cluster < T > > cluster ( final Collection < T > points ) throws NullArgumentException { MathUtils . checkNotNull ( points ) ; final List < Cluster < T > > clusters = new ArrayList < Cluster < T > > ( ) ; final List < Cluster < T > > anomalousClusters = new ArrayList < Cluster < T > > ( ) ; final Cluster < T > anomalyCluster = new Cluster < T > ( ) ; final Map < Clusterable , PointStatus > visited = new HashMap < Clusterable , PointStatus > ( ) ; for ( final T point : points ) { if ( visited . get ( point ) != null ) { continue ; } final List < T > neighbors = getNeighbors ( point , points ) ; if ( neighbors . size ( ) >= minPts ) { final Cluster < T > cluster = new Cluster < T > ( ) ; clusters . add ( expandCluster ( cluster , point , neighbors , points , visited ) ) ; } else { visited . put ( point , PointStatus . NOISE ) ; anomalyCluster . addPoint ( point ) ; } } anomalousClusters . add ( anomalyCluster ) ; return anomalousClusters ; }
performs dbscan cluster analysis .
