@@ -0,0 +1,1108 @@
+package edu.neu.ccs.pyramid.classification.logistic_regression;%0A%0Aimport edu.neu.ccs.pyramid.util.Pair;%0Aimport org.apache.mahout.math.Vector;%0A%0Aimport java.util.Comparator;%0Aimport java.util.List;%0Aimport java.util.stream.Collectors;%0Aimport java.util.stream.IntStream;%0A%0A%0A/**%0A * Created by chengli on 12/7/14.%0A */%0Apublic class LogisticRegressonInspector %7B%0A    public static List%3CPair%3CInteger,String%3E%3E topFeatures(LogisticRegression logisticRegression,%0A                                                         int k)%7B%0A        String%5B%5D featureNames = logisticRegression.getFeatureNames();%0A        Vector weights = logisticRegression.getWeights().getWeightsWithoutBiasForClass(k);%0A        Comparator%3CPair%3CInteger,Double%3E%3E comparator = Comparator.comparing(Pair::getSecond);%0A        return IntStream.range(0,weights.size()).mapToObj(i -%3E new Pair%3C%3E(i,weights.get(i)))%0A                .filter(pair -%3E pair.getSecond()%3E0)%0A                .sorted(comparator.reversed())%0A                .map(Pair::getFirst)%0A                .map(i -%3E new Pair%3C%3E(i, featureNames%5Bi%5D))%0A                .collect(Collectors.toList());%0A    %7D%0A%7D%0A

add class LogisticRegressonInspector