public static Distribution guessNumberOfBins(DataSet data){
  if (data.getSampleSize() < 20)   return new UniformDiscrete(2,data.getSampleSize() - 1);
 else   if (data.getSampleSize() >= 1000000)   return new LogUniform(50,1000);
  int sqrt=(int)Math.sqrt(data.getSampleSize());
  return new UniformDiscrete(Math.max(sqrt / 3,2),Math.min(sqrt * 3,data.getSampleSize() - 1));
}

public static Distribution guessNumberOfBins ( DataSet data ) { if ( data . getSampleSize ( ) < 20 ) return new UniformDiscrete ( 2 , data . getSampleSize ( ) - 1 ) ; else if ( data . getSampleSize ( ) >= 1000000 ) return new LogUniform ( 50 , 1000 ) ; int sqrt = ( int ) Math . sqrt ( data . getSampleSize ( ) ) ; return new UniformDiscrete ( Math . max ( sqrt / 3 , 2 ) , Math . min ( sqrt * 3 , data . getSampleSize ( ) - 1 ) ) ; }
attempts to guess the number of bins to use
