This commit is contained in:
Gianpaolo Coro 2012-09-12 07:43:14 +00:00
parent c00825d446
commit 578dc03902
3 changed files with 11 additions and 8 deletions

View File

@ -311,7 +311,7 @@ public class DBScan implements Clusterer{
//take cluster element indexes //take cluster element indexes
int npoints = c.getExampleIds().size(); int npoints = c.getExampleIds().size();
AnalysisLogger.getLogger().debug("Analyzing Cluster ->"+id+" with "+npoints); AnalysisLogger.getLogger().debug("Analyzing Cluster ->"+id+" with "+npoints);
if (npoints<minpoints) if (npoints<=minpoints)
outlier=true; outlier=true;
int k=0; int k=0;

View File

@ -259,7 +259,7 @@ public class XMeansWrapper extends DBScan {
for (int k = 0; k < nrows; k++) { for (int k = 0; k < nrows; k++) {
bufferRows.append("("); bufferRows.append("(");
int cindex = clusteringAssignments[k]; int cindex = clusteringAssignments[k];
boolean isoutlier = (counters[cindex]<minpoints); boolean isoutlier = (counters[cindex]<=minpoints);
for (int j = 0; j < ncols; j++) { for (int j = 0; j < ncols; j++) {
bufferRows.append(samplesVector[k][j]); bufferRows.append(samplesVector[k][j]);

View File

@ -19,11 +19,13 @@ public static void main(String[] args) throws Exception {
System.out.println("TEST 1"); System.out.println("TEST 1");
List<Clusterer> clus; List<Clusterer> clus;
clus = ClusterersFactory.getClusterers(testConfigLocal()); clus = ClusterersFactory.getClusterers(testConfigLocal());
clus.get(0).init(); clus.get(0).init();
Regressor.process(clus.get(0)); Regressor.process(clus.get(0));
clus = null; clus = null;
clus = ClusterersFactory.getClusterers(testConfigLocal2()); clus = ClusterersFactory.getClusterers(testConfigLocal2());
clus.get(0).init(); clus.get(0).init();
Regressor.process(clus.get(0)); Regressor.process(clus.get(0));
@ -33,6 +35,7 @@ public static void main(String[] args) throws Exception {
clus.get(0).init(); clus.get(0).init();
Regressor.process(clus.get(0)); Regressor.process(clus.get(0));
clus = null; clus = null;
} }
@ -45,7 +48,7 @@ public static void main(String[] args) throws Exception {
config.setParam("FeaturesColumnNames","centerlong"+AlgorithmConfiguration.getListSeparator()+"centerlat"); config.setParam("FeaturesColumnNames","centerlong"+AlgorithmConfiguration.getListSeparator()+"centerlat");
config.setParam("OccurrencePointsClusterTable","occcluster_dbscan"); config.setParam("OccurrencePointsClusterTable","occcluster_dbscan");
config.setParam("epsilon","10"); config.setParam("epsilon","10");
config.setParam("min_points","3"); config.setParam("min_points","1");
return config; return config;
} }
@ -59,10 +62,10 @@ public static void main(String[] args) throws Exception {
config.setParam("OccurrencePointsTable","presence_basking_cluster"); config.setParam("OccurrencePointsTable","presence_basking_cluster");
config.setParam("FeaturesColumnNames","centerlong"+AlgorithmConfiguration.getListSeparator()+"centerlat"); config.setParam("FeaturesColumnNames","centerlong"+AlgorithmConfiguration.getListSeparator()+"centerlat");
config.setParam("OccurrencePointsClusterTable","occcluster_kmeans"); config.setParam("OccurrencePointsClusterTable","occcluster_kmeans");
config.setParam("k","30"); config.setParam("k","24");
config.setParam("max_runs","1000"); config.setParam("max_runs","1000");
config.setParam("max_optimization_steps","1000"); config.setParam("max_optimization_steps","1000");
config.setParam("min_points","3"); config.setParam("min_points","1");
return config; return config;
} }
@ -77,9 +80,9 @@ public static void main(String[] args) throws Exception {
config.setParam("FeaturesColumnNames","centerlong"+AlgorithmConfiguration.getListSeparator()+"centerlat"); config.setParam("FeaturesColumnNames","centerlong"+AlgorithmConfiguration.getListSeparator()+"centerlat");
config.setParam("OccurrencePointsClusterTable","occcluster_xmeans"); config.setParam("OccurrencePointsClusterTable","occcluster_xmeans");
config.setParam("maxIterations","1000"); config.setParam("maxIterations","1000");
config.setParam("minClusters","30"); config.setParam("minClusters","20");
config.setParam("maxClusters","50"); config.setParam("maxClusters","30");
config.setParam("min_points","3"); config.setParam("min_points","1");
return config; return config;
} }