@@ -0,0 +1,2638 @@
+package edu.neu.ccs.pyramid.experiment;%0A%0Aimport edu.neu.ccs.pyramid.configuration.Config;%0Aimport edu.neu.ccs.pyramid.dataset.DataSetType;%0Aimport edu.neu.ccs.pyramid.dataset.MultiLabelClfDataSet;%0Aimport edu.neu.ccs.pyramid.dataset.TRECFormat;%0Aimport edu.neu.ccs.pyramid.eval.Accuracy;%0Aimport edu.neu.ccs.pyramid.eval.Overlap;%0Aimport edu.neu.ccs.pyramid.multilabel_classification.bmm.BMMClassifier;%0Aimport edu.neu.ccs.pyramid.multilabel_classification.bmm.BMMOptimizer;%0A%0Aimport java.io.IOException;%0A%0A/**%0A * BMM multi-label %0A * Created by chengli on 10/8/15.%0A */%0Apublic class Exp210 %7B%0A    public static void main(String%5B%5D args) throws IOException, ClassNotFoundException %7B%0A        if (args.length != 1) %7B%0A            throw new IllegalArgumentException(%22Please specify a properties file.%22);%0A        %7D%0A%0A        Config config = new Config(args%5B0%5D);%0A        System.out.println(config);%0A%0A        MultiLabelClfDataSet trainSet = TRECFormat.loadMultiLabelClfDataSet(config.getString(%22input.trainData%22), %0A                DataSetType.ML_CLF_SPARSE, true);%0A%0A        MultiLabelClfDataSet testSet = TRECFormat.loadMultiLabelClfDataSet(config.getString(%22input.testData%22),%0A                DataSetType.ML_CLF_SPARSE, true);%0A%0A        int numClusters = config.getInt(%22numClusters%22);%0A        double variance = config.getDouble(%22variance%22);%0A        int numIterations = config.getInt(%22numIterations%22);%0A        %0A        BMMClassifier bmmClassifier = new BMMClassifier(trainSet.getNumClasses(),numClusters,trainSet.getNumFeatures());%0A        BMMOptimizer optimizer = new BMMOptimizer(bmmClassifier,trainSet,variance);%0A%0A        System.out.println(%22after initialization%22);%0A        System.out.println(%22train acc = %22+ Accuracy.accuracy(bmmClassifier, trainSet));%0A        System.out.println(%22train overlap = %22+ Overlap.overlap(bmmClassifier, trainSet));%0A        System.out.println(%22test acc = %22+ Accuracy.accuracy(bmmClassifier,testSet));%0A        System.out.println(%22test overlap = %22+ Overlap.overlap(bmmClassifier, testSet));%0A%0A        for (int i=1;i%3C=numIterations;i++)%7B%0A            optimizer.iterate();%0A            System.out.println(%22after iteration %22+i);%0A            System.out.println(%22train acc = %22+ Accuracy.accuracy(bmmClassifier,trainSet));%0A            System.out.println(%22train overlap = %22+ Overlap.overlap(bmmClassifier, trainSet));%0A            System.out.println(%22test acc = %22+ Accuracy.accuracy(bmmClassifier,testSet));%0A            System.out.println(%22test overlap = %22+ Overlap.overlap(bmmClassifier, testSet));%0A        %7D%0A%0A        System.out.println(%22history = %22+optimizer.getTerminator().getHistory());%0A        System.out.println(bmmClassifier);%0A    %7D%0A%7D%0A

add Exp210