public static String datasetStats ( Map < String , List < double [ ] > > data , String name ) { int globalMinLength = Integer . MAX_VALUE ; int globalMaxLength = Integer . MIN_VALUE ; double globalMinValue = Double . MAX_VALUE ; double globalMaxValue = Double . MIN_VALUE ; for ( Entry < String , List < double [ ] > > e : data . entrySet ( ) ) { for ( double [ ] dataEntry : e . getValue ( ) ) { globalMaxLength = ( dataEntry . length > globalMaxLength ) ? dataEntry . length : globalMaxLength ; globalMinLength = ( dataEntry . length < globalMinLength ) ? dataEntry . length : globalMinLength ; for ( double value : dataEntry ) { globalMaxValue = ( value > globalMaxValue ) ? value : globalMaxValue ; globalMinValue = ( value < globalMinValue ) ? value : globalMinValue ; } } } StringBuffer sb = new StringBuffer ( ) ; sb . append ( name ) . append ( "classes: " ) . append ( data . size ( ) ) ; sb . append ( ", series length min: " ) . append ( globalMinLength ) ; sb . append ( ", max: " ) . append ( globalMaxLength ) ; sb . append ( ", min value: " ) . append ( globalMinValue ) ; sb . append ( ", max value: " ) . append ( globalMaxValue ) . append ( ";" ) ; for ( Entry < String , List < double [ ] > > e : data . entrySet ( ) ) { sb . append ( name ) . append ( " class: " ) . append ( e . getKey ( ) ) ; sb . append ( " series: " ) . append ( e . getValue ( ) . size ( ) ) . append ( ";" ) ; } return sb . delete ( sb . length ( ) - 1 , sb . length ( ) ) . toString ( ) ; }
Prints the dataset statistics .