Example usage for org.apache.mahout.classifier.df.data Dataset toJSON

List of usage examples for org.apache.mahout.classifier.df.data Dataset toJSON

Introduction

In this page you can find the example usage for org.apache.mahout.classifier.df.data Dataset toJSON.

Prototype

public String toJSON() 

Source Link

Document

Serialize this instance to JSON

Usage

From source file:imageClassify.Describe.java

License:Apache License

private static void runTool(String dataPath, Iterable<String> description, String filePath, boolean regression)
        throws DescriptorException, IOException {
    log.info("Generating the descriptor...");
    String descriptor = DescriptorUtils.generateDescriptor(description);

    Path fPath = validateOutput(filePath);

    log.info("generating the dataset...");
    Dataset dataset = generateDataset(descriptor, dataPath, regression);

    log.info("storing the dataset description");
    String json = dataset.toJSON();
    DFUtils.storeString(new Configuration(), fPath, json);
}