package edu.neu.ccs.pyramid.experiment;

import edu.neu.ccs.pyramid.classification.Classifier;
import edu.neu.ccs.pyramid.classification.logistic_regression.LogisticRegression;
import edu.neu.ccs.pyramid.configuration.Config;
import edu.neu.ccs.pyramid.multilabel_classification.bmm_variant.BMMClassifier;
import edu.neu.ccs.pyramid.util.Serialization;

/**
 * check bmm classifier
 * Created by chengli on 11/24/15.
 */
public class Exp214 {
    public static void main(String[] args) {

    }

    private static void show(BMMClassifier bmmClassifier){
        int numClusters = bmmClassifier.getNumClusters();
        int numClasses = bmmClassifier.getNumClasses();
        Classifier.ProbabilityEstimator[][] classifiers = bmmClassifier.getBinaryClassifiers();
        LogisticRegression logisticRegression1 = classifiers[0][0];

    }

    private static BMMClassifier loadModel(Config config) throws Exception{
        String model = config.getString("model");
        BMMClassifier bmm = (BMMClassifier)Serialization.deserialize(model);
        return bmm;
    }


}

@@ -479,17 +479,310 @@
 %5D args) 
-%7B
+throws Exception%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%0A        System.out.println(config);%0A%0A        BMMClassifier bmm = loadModel(config);%0A        show(bmm);
 %0A%0A    %7D%0A
@@ -1104,25 +1104,347 @@
 1 = 
-classifiers%5B0%5D%5B0%5D
+(LogisticRegression)classifiers%5B0%5D%5B0%5D;%0A        LogisticRegression logisticRegression2 = (LogisticRegression)classifiers%5B1%5D%5B0%5D;%0A        System.out.println(%22lr in cluster%22+0+%22 =%22+logisticRegression1.getWeights().getWeightsForClass(1));%0A        System.out.println(%22lr in cluster%22+1+%22 =%22+logisticRegression2.getWeights().getWeightsForClass(1))
 ;%0A%0A 

fix Exp214