private void debugFeatureValue ( String feature , int index , ConcatVector vector , BufferedWriter bw ) throws IOException { bw . write ( "\t" ) ; if ( sparseFeatureIndex . containsKey ( feature ) && sparseFeatureIndex . get ( feature ) . values ( ) . contains ( index ) ) { // we can map this index to an interpretable string, so we do bw . write ( "SPARSE VALUE \"" ) ; bw . write ( reverseSparseFeatureIndex . get ( feature ) . get ( index ) ) ; bw . write ( "\"" ) ; } else { // we can't map this to a useful string, so we default to the number bw . write ( Integer . toString ( index ) ) ; } bw . write ( ": " ) ; bw . write ( Double . toString ( vector . getValueAt ( featureToIndex . getOrDefault ( feature , - 1 ) , index ) ) ) ; bw . write ( "\n" ) ; }
This writes a feature s individual value using the human readable name if possible to a StringBuilder