public static void saveData ( Map < String , List < double [ ] > > data , File file ) throws IOException { BufferedWriter bw = new BufferedWriter ( new FileWriter ( file ) ) ; for ( Entry < String , List < double [ ] > > classEntry : data . entrySet ( ) ) { String classLabel = classEntry . getKey ( ) ; for ( double [ ] arr : classEntry . getValue ( ) ) { String arrStr = Arrays . toString ( arr ) . replaceAll ( "[\\]\\[\\s]+" , "" ) ; bw . write ( classLabel + "," + arrStr + CR ) ; } } bw . close ( ) ; }
Saves the dataset .