Example usage for org.apache.mahout.classifier.df DFUtils storeString

List of usage examples for org.apache.mahout.classifier.df DFUtils storeString

Introduction

In this page you can find the example usage for org.apache.mahout.classifier.df DFUtils storeString.

Prototype

public static void storeString(Configuration conf, Path path, String string) throws IOException 

Source Link

Document

Write a string to a path.

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);
}