Examples of classifyScalar()


Examples of org.apache.mahout.classifier.sgd.OnlineLogisticRegression.classifyScalar()

        assertEquals(1.0, z, 1e-2);

        // just for grins, we should check whether the model actually computes the correct values
        List<String> categories = ImmutableList.of("0", "1");
        for (Tuple example : examples) {
            double score = model.classifyScalar(PigVector.fromBytes((DataByteArray) example.get(1)));
            int actual = categories.indexOf(example.get(0));
            score = score * actual + (1 - score) * (1 - actual);
            assertTrue(score > 0.4);
        }
    }
View Full Code Here

Examples of org.apache.mahout.classifier.sgd.OnlineLogisticRegression.classifyScalar()

          lr.train(observation.getTarget(), observation.asVector());
        }
        if (pass % 5 == 0) {
          Auc eval = new Auc(0.5);
          for (TelephoneCall testCall : test) {
            eval.add(testCall.getTarget(), lr.classifyScalar(testCall.asVector()));
          }
          System.out.printf("%d, %.4f, %.4f\n", pass, lr.currentLearningRate(), eval.auc());
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.