Examples of predict()


Examples of org.data2semantics.proppred.predictors.SVMPropertyPredictor.predict()

    // Train on the first 100 instances
    pred.train(dataset, instances.subList(0, 100), labels.subList(0, 100), blackLists);
   
    // Predict on the rest, note that we also need the blacklists here, since the labels already occur in the test set as well,
    // because we do not use an unlabeled test set, which we would use in an application setting.
    List<Value> predictions = pred.predict(dataset, instances.subList(100,instances.size()), blackLists);
   
    // Make a sublist of the labels of the test set
    List<Value> testLabels = labels.subList(100, labels.size());

    // Print out the predictions and compute the accuracy on the test set.
View Full Code Here

Examples of org.gd.spark.opendl.downpourSGD.Softmax.LR.predict()

           
            int trueCount = 0;
            int falseCount = 0;
            double[] predict_y = new double[y_feature];
            for(SampleVector test : testList) {
              lr.predict(test.getX(), predict_y);
              if(ClassVerify.classTrue(test.getY(), predict_y)) {
                trueCount++;
              }
              else {
                falseCount++;
View Full Code Here

Examples of org.gd.spark.opendl.downpourSGD.Softmax.LR.predict()

           
            int trueCount = 0;
            int falseCount = 0;
            double[] predict_y = new double[y_feature];
            for(SampleVector test : testList) {
              lr.predict(test.getX(), predict_y);
              if(ClassVerify.classTrue(test.getY(), predict_y)) {
                trueCount++;
              }
              else {
                falseCount++;
View Full Code Here

Examples of org.grouplens.lenskit.RatingPredictor.predict()

    @Override
    public SparseVector getPredictions() {
        if (predictionCache == null) {
            RatingPredictor pred = recommender.getRatingPredictor();
            if (pred != null) {
                predictionCache = pred.predict(getUserId(), getTestRatings().keySet());
            }
        }
        return predictionCache;
    }
View Full Code Here

Examples of org.grouplens.lenskit.RatingPredictor.predict()

                                         .addScore(42, 3, 3.0)
                                         .build();
        ItemScorer scorer = new FallbackItemScorer(primary, base1);
        RatingPredictor pred = new SimpleRatingPredictor(scorer, base2, null);
        MutableSparseVector vec = MutableSparseVector.create(1, 2, 3);
        pred.predict(42, vec);
        assertThat(vec.size(), equalTo(3));
        assertThat(vec.get(1), equalTo(3.5));
        assertThat(vec.get(2), equalTo(2.5));
        assertThat(vec.get(3), equalTo(3.0));
        assertThat(vec.getChannel(FallbackItemScorer.SCORE_SOURCE_SYMBOL).get(1),
View Full Code Here

Examples of org.grouplens.lenskit.RatingPredictor.predict()

        }

        logger.info("predicting {} items", items.size());
        Symbol pchan = getPrintChannel();
        Stopwatch timer = Stopwatch.createStarted();
        SparseVector preds = pred.predict(user, items);
        Long2ObjectMap channel = null;
        if (pchan != null) {
            for (TypedSymbol sym: preds.getChannelSymbols()) {
                if (sym.getRawSymbol().equals(pchan)) {
                    channel = preds.getChannel(sym);
View Full Code Here

Examples of quickml.supervised.regressionModel.IsotonicRegression.PoolAdjacentViolatorsModel.predict()

        PoolAdjacentViolatorsModel pav = new PoolAdjacentViolatorsModel(observations, 4);
        PoolAdjacentViolatorsModel.Observation prev = null;
     //   observations.sort(Comparator.<PoolAdjacentViolatorsModel.Observation>naturalOrder());
        for (PoolAdjacentViolatorsModel.Observation observation : observations) {

            PoolAdjacentViolatorsModel.Observation obsToAdd = new PoolAdjacentViolatorsModel.Observation(observation.input, pav.predict(observation.input));
            predictions.add(obsToAdd);

        if (prev !=null && prev.output < observation.output)
                System.out.println("prev out: " + prev.toString() + ". obs.input: " + obsToAdd.toString());
            prev = obsToAdd;
View Full Code Here

Examples of quickml.supervised.regressionModel.LinearRegression.RidgeLinearModel.predict()

        double pythonRMSE = Math.sqrt(212.32/trainingData.size());
        double pythonEpsilon = pythonRMSE/25.0;
        double mse = 0;
        for (Instance<double[]> instance : trainingData) {
            double [] x = instance.getAttributes();
            logger.info("prediction " + ridgeLinearModel.predict(x) + ". label: " + instance.getLabel());
            mse+= Math.pow(ridgeLinearModel.predict(x) - (Double)instance.getLabel(), 2);
            logger.info("un-normalized mse " + mse);
        }
        mse/=trainingData.size();
        double RMSE = Math.sqrt(mse);
View Full Code Here

Examples of tv.floe.metronome.deeplearning.dbn.DeepBeliefNetwork.predict()





    Matrix predict = dbn.predict( x_xor_Matrix );
    System.out.println("--- Predictions XOR ----");
    MatrixUtils.debug_print(predict);
    //log.info(predict.toString());

    Evaluation eval = new Evaluation();
View Full Code Here

Examples of tv.floe.metronome.deeplearning.neuralnetwork.core.BaseMultiLayerNeuralNetworkVectorized.predict()

     
      DataSet inputs = iterator.next();

      Matrix in = inputs.getFirst();
      Matrix outcomes = inputs.getSecond();
      Matrix predicted = load.predict(in);
      eval.eval( outcomes, predicted );
     
    }
   
   
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.