Package com.flaptor.hist4j

Examples of com.flaptor.hist4j.AdaptiveHistogram.addValue()


                maxFreq = 0;
                AdaptiveHistogram hist = new AdaptiveHistogram();
                termEnum = reader.terms(new Term(field,""));

                while (termEnum.next()) {
                    hist.addValue(termEnum.docFreq());
                    terms++;
                    maxFreq = Math.max(maxFreq,termEnum.docFreq());
                }

                threshold = (int)hist.getValueForPercentile(90);
View Full Code Here


        System.out.println();
        System.out.println("Loading 10000 Gauss(0,1) data points into the histogram.");
       
        for (int i=0; i < 10000; i ++) {
            h.addValue((float)rnd.nextGaussian());
        }

        System.out.println();
        System.out.println("Main percentiles:");
        System.out.println("   5%: " + h.getValueForPercentile(5));
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.