Examples of compute()


Examples of org.apache.commons.math3.ml.distance.EuclideanDistance.compute()

        final double[] features = new double[] { 0.3 };
        final double[] distancesBefore = new double[netSize];
        int count = 0;
        for (Neuron n : net) {
            distancesBefore[count++] = dist.compute(n.getFeatures(), features);
        }
        final Neuron bestBefore = MapUtils.findBest(features, net, dist);

        // Initial distance from the best match is larger than zero.
        Assert.assertTrue(dist.compute(bestBefore.getFeatures(), features) >= 0.2);
View Full Code Here

Examples of org.apache.commons.math3.ml.distance.EuclideanDistance.compute()

            distancesBefore[count++] = dist.compute(n.getFeatures(), features);
        }
        final Neuron bestBefore = MapUtils.findBest(features, net, dist);

        // Initial distance from the best match is larger than zero.
        Assert.assertTrue(dist.compute(bestBefore.getFeatures(), features) >= 0.2);

        update.update(net, features);

        final double[] distancesAfter = new double[netSize];
        count = 0;
View Full Code Here

Examples of org.apache.commons.math3.ml.distance.EuclideanDistance.compute()

        update.update(net, features);

        final double[] distancesAfter = new double[netSize];
        count = 0;
        for (Neuron n : net) {
            distancesAfter[count++] = dist.compute(n.getFeatures(), features);
        }
        final Neuron bestAfter = MapUtils.findBest(features, net, dist);

        Assert.assertEquals(bestBefore, bestAfter);
        // Distance is now zero.
View Full Code Here

Examples of org.apache.commons.math3.ml.distance.EuclideanDistance.compute()

        }
        final Neuron bestAfter = MapUtils.findBest(features, net, dist);

        Assert.assertEquals(bestBefore, bestAfter);
        // Distance is now zero.
        Assert.assertEquals(0, dist.compute(bestAfter.getFeatures(), features), 0d);

        for (int i = 0; i < netSize; i++) {
            // All distances have decreased.
            Assert.assertTrue(distancesAfter[i] < distancesBefore[i]);
        }
View Full Code Here

Examples of org.apache.lucene.facet.search.FacetResultsHandler.compute()

                    aggregator.rollupValues(fr, rootOrd, children, siblings, facetArrays);
                }
            }

            FacetResultsHandler frh = createFacetResultsHandler(fr);
            res.add(frh.compute());
        }
        return res;
    }
}
View Full Code Here

Examples of org.apache.mahout.clustering.GaussianAccumulator.compute()

    List<VectorWritable> repPts = representativePoints.get(cI);
    GaussianAccumulator accumulator = new OnlineGaussianAccumulator();
    for (VectorWritable vw : repPts) {
      accumulator.observe(vw.get(), 1.0);
    }
    accumulator.compute();
    double d = accumulator.getAverageStd();
    stDevs.put(cI, d);
  }

  /**
 
View Full Code Here

Examples of org.apache.mahout.clustering.OnlineGaussianAccumulator.compute()

    List<VectorWritable> repPts = representativePoints.get(cI);
    GaussianAccumulator accumulator = new OnlineGaussianAccumulator();
    for (VectorWritable vw : repPts) {
      accumulator.observe(vw.get(), 1.0);
    }
    accumulator.compute();
    double d = accumulator.getAverageStd();
    stDevs.put(cI, d);
  }

  /**
 
View Full Code Here

Examples of org.carrot2.matrix.factorization.KMeansMatrixFactorization.compute()

    {
        KMeansMatrixFactorization kMeansMatrixFactorization = new KMeansMatrixFactorization(
                A);
        kMeansMatrixFactorization.setK(U.columns());
        kMeansMatrixFactorization.setMaxIterations(maxIterations);
        kMeansMatrixFactorization.compute();

        U.assign(kMeansMatrixFactorization.getU());
        for (int r = 0; r < U.rows(); r++)
        {
            for (int c = 0; c < U.columns(); c++)
View Full Code Here

Examples of org.data2semantics.exp.old.kernels.RDFWLSubTreeKernelString.compute()

      RDFGraphKernel k = new RDFWLSubTreeKernelString(6,3, false, true);
 
     
      System.out.println("RDF WL String: " + frac);
      tic = System.currentTimeMillis();
      k.compute(dataset, instances, blackList);
      toc = System.currentTimeMillis();
      double[] comp = {toc-tic};
      Result res = new Result(comp, "comp time");
      resTable.addResult(res);
    }
View Full Code Here

Examples of org.data2semantics.proppred.kernels.graphkernels.FeatureVectorKernel.compute()

     
      GraphKernel k = new WLSubTreeKernel(6,true);
     
      System.out.println("WL: " + frac);
      tic = System.currentTimeMillis();
      k.compute(ds.getGraphs());
      toc = System.currentTimeMillis();
      double[] comp = {(toc-tic) + dsComp};
      Result res = new Result(comp, "comp time");
      resTable.addResult(res);
    }   
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.