Example usage for org.apache.mahout.classifier.sgd RecordFactory getTraceDictionary

List of usage examples for org.apache.mahout.classifier.sgd RecordFactory getTraceDictionary

Introduction

In this page you can find the example usage for org.apache.mahout.classifier.sgd RecordFactory getTraceDictionary.

Prototype

Map<String, Set<Integer>> getTraceDictionary();

Source Link

Usage

From source file:TrainLogistic.java

License:Apache License

private static double predictorWeight(OnlineLogisticRegression lr, int row, RecordFactory csv,
        String predictor) {/* w ww .j a v  a  2 s.  c o  m*/
    double weight = 0;
    for (Integer column : csv.getTraceDictionary().get(predictor)) {
        weight += lr.getBeta().get(row, column);
    }
    return weight;
}