Skip to content
Permalink
3b99e145f5
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
42 lines (32 sloc) 1.49 KB
package clustering.test;
import java.util.List;
import activity.ActivityFrame;
import clustering.HeuristicTopDownClusteringDynamicSparse;
import clustering.ds.CSKSimpleCluster;
import clustering.ds.Instance;
import tool.InformationExtraction;
public class HeuristicTopDownClusteringDynamicSparseTest {
public static void main(String[] args) throws Exception {
long startTime = System.currentTimeMillis();
String input = "/var/tmp/cxchu/groundtruth-data/cate-domain.json";
List<ActivityFrame> allframe = InformationExtraction.getAllFrame(input);
System.out.println("Initializing simple topdown clustering.....");
HeuristicTopDownClusteringDynamicSparse cluster = new HeuristicTopDownClusteringDynamicSparse(allframe, false, 0.9, 5, 0.5);
System.out.println("Done! Start clustering.......");
int k=2;
List<CSKSimpleCluster<ActivityFrame>> res = cluster.splitACluster(cluster.getInputCluster(), k);
System.out.println("Done! Results..............");
for (int i=0; i<res.size(); i++){
List<Instance<ActivityFrame>> frames = res.get(i).getClusterMembers();
for (int j=0; j<frames.size(); j++){
System.out.println(frames.get(j).getData());
}
System.out.println(frames.size());
System.out.println("====================================");
}
System.out.println("Number of clusters: " + res.size());
long endTime = System.currentTimeMillis();
long totalTime = (endTime - startTime)/1000;
System.out.println("Running time: " + totalTime + "second(s)");
}
}