public String toDistributionString ( int treshold ) { Counter < Double > weightCounts = new ClassicCounter < Double > ( ) ; StringBuilder s = new StringBuilder ( ) ; s . append ( "Total number of weights: " ) . append ( totalSize ( ) ) ; for ( int f = 0 ; f < weights . length ; f ++ ) { for ( int l = 0 ; l < weights [ f ] . length ; l ++ ) { weightCounts . incrementCount ( weights [ f ] [ l ] ) ; } } s . append ( "Counts of weights\n" ) ; Set < Double > keys = Counters . keysAbove ( weightCounts , treshold ) ; s . append ( keys . size ( ) ) . append ( " keys occur more than " ) . append ( treshold ) . append ( " times " ) ; return s . toString ( ) ; }
Similar to histogram but exact values of the weights to see whether there are many equal weights .