Example usage for org.apache.mahout.classifier.sgd ElasticBandPrior ElasticBandPrior

List of usage examples for org.apache.mahout.classifier.sgd ElasticBandPrior ElasticBandPrior

Introduction

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

Prototype

public ElasticBandPrior(double alphaByLambda) 

Source Link

Usage

From source file:com.ml.ira.algos.AdaptiveLogisticModelParameters.java

License:Apache License

private static PriorFunction createPrior(String cmd, double priorOption) {
    if (cmd == null) {
        return null;
    }/*from w w w.ja  v a2s  .c o  m*/
    if ("L1".equals(cmd.toUpperCase(Locale.ENGLISH).trim())) {
        return new L1();
    }
    if ("L2".equals(cmd.toUpperCase(Locale.ENGLISH).trim())) {
        return new L2();
    }
    if ("UP".equals(cmd.toUpperCase(Locale.ENGLISH).trim())) {
        return new UniformPrior();
    }
    if ("TP".equals(cmd.toUpperCase(Locale.ENGLISH).trim())) {
        return new TPrior(priorOption);
    }
    if ("EBP".equals(cmd.toUpperCase(Locale.ENGLISH).trim())) {
        return new ElasticBandPrior(priorOption);
    }

    return null;
}