}
}
System.out.println(bigBag.entropy());
Map<String,Double> saves = new HashMap<String,Double>();
SimpleRegression sr = new SimpleRegression();
for(String s : bigBag.getList()) {
Bag<String> b = index.get(s);
//double entropy = b.entropy();
//double crossEntropy = b.crossEntropy(bigBag);
//double compressionSaves = (crossEntropy - entropy);
//System.out.println(s + "\t" + bigBag.getCount(s) + "\t" + entropy + "\t" + compressionSaves);
//saves.put(s, mutualInformation(bigBag, b));
//Bag<String> bb = new Bag<String>(b);
//bb.discardInfrequent(10);
//if(bb.size() == 0) continue;
System.out.println(s + "\t" + b.totalCount() + "\t" + b.size());
sr.addData(Math.log(b.totalCount()), Math.log(b.size()));
}
System.out.println(sr.getRSquare());
double m = sr.getSlope();
double c = sr.getIntercept();
for(String s : bigBag.getList()) {
Bag<String> b = index.get(s);
saves.put(s, m * Math.log(b.totalCount()) + c - Math.log(b.size()));
}