Example usage for org.apache.mahout.utils.clustering GraphMLClusterWriter GraphMLClusterWriter

List of usage examples for org.apache.mahout.utils.clustering GraphMLClusterWriter GraphMLClusterWriter

Introduction

In this page you can find the example usage for org.apache.mahout.utils.clustering GraphMLClusterWriter GraphMLClusterWriter.

Prototype

public GraphMLClusterWriter(Writer writer, Map<Integer, List<WeightedPropertyVectorWritable>> clusterIdToPoints,
            DistanceMeasure measure, int numTopFeatures, String[] dictionary, int subString) throws IOException 

Source Link

Usage

From source file:tk.summerway.mahout9.tools.MyClusterDumper.java

License:Apache License

ClusterWriter createClusterWriter(Writer writer, String[] dictionary) throws IOException {
    ClusterWriter result;/*from w w  w.ja  v a 2 s . c  o  m*/

    switch (outputFormat) {
    case TEXT:
        result = new ClusterDumperWriter(writer, clusterIdToPoints, measure, numTopFeatures, dictionary,
                subString);
        break;
    case CSV:
        result = new CSVClusterWriter(writer, clusterIdToPoints, measure);
        break;
    case GRAPH_ML:
        result = new GraphMLClusterWriter(writer, clusterIdToPoints, measure, numTopFeatures, dictionary,
                subString);
        break;
    case JSON:
        result = new JsonClusterWriter(writer, clusterIdToPoints, measure, numTopFeatures, dictionary);
        break;
    default:
        throw new IllegalStateException("Unknown outputformat: " + outputFormat);
    }
    return result;
}