Package org.apache.mahout.classifier.sgd

Examples of org.apache.mahout.classifier.sgd.L1


    lines.setTraceDictionary(traceDictionary);
    Dictionary newsGroups = new Dictionary();
   
    OnlineLogisticRegression learningAlgorithm =
        new OnlineLogisticRegression(
              20, FEATURES, new L1())
            .alpha(1).stepOffset(1000)
            .decayExponent(0.9)
            .lambda(3.0e-5)
            .learningRate(20);
   
View Full Code Here


    }

    Dictionary newsGroups = new Dictionary();

    encoder.setProbes(2);
    AdaptiveLogisticRegression learningAlgorithm = new AdaptiveLogisticRegression(20, FEATURES, new L1());
    learningAlgorithm.setInterval(800);
    learningAlgorithm.setAveragingWindow(500);

    List<File> files = Lists.newArrayList();
    File[] directories = base.listFiles();
View Full Code Here

            if (options.containsKey("categories") && options.containsKey("features")) {
                categories = Lists.newArrayList(onSpaces.split(options.get("categories")));
                if (categories.size() < 2) {
                    throw new BadClassifierSpecException("Must have more than one target category.  Remember that categories is a space separated list");
                }
                model = new OnlineLogisticRegression(categories.size(), Integer.parseInt(options.get("features")), new L1());
                options.remove("categories");
                options.remove("features");
            } else {
                throw new BadClassifierSpecException("Must specify previous model location using \"file\" or supply \"categories\" and \"features\"");
            }
View Full Code Here

      Collections.shuffle(calls);
      int cutoff = (int) (heldOutPercentage * calls.size());
      List<TelephoneCall> test = calls.subList(0, cutoff);
      List<TelephoneCall> train = calls.subList(cutoff, calls.size());

      OnlineLogisticRegression lr = new OnlineLogisticRegression(NUM_CATEGORIES, TelephoneCall.FEATURES, new L1())
        .learningRate(1)
        .alpha(1)
        .lambda(0.000001)
        .stepOffset(10000)
        .decayExponent(0.2);
View Full Code Here

TOP

Related Classes of org.apache.mahout.classifier.sgd.L1

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.