Example usage for org.apache.mahout.classifier.df.data DescriptorUtils generateDescriptor

List of usage examples for org.apache.mahout.classifier.df.data DescriptorUtils generateDescriptor

Introduction

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

Prototype

public static String generateDescriptor(Iterable<String> tokens) throws DescriptorException 

Source Link

Document

Generates a valid descriptor string from a list of tokens

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