question: public void convertStringAttsToNominal ( ) { Instances miningSchemaI = getFieldsAsInstances ( ) ; if ( miningSchemaI . checkForStringAttributes ( ) ) { ArrayList < Attribute > attInfo = new ArrayList < Attribute > ( ) ; for ( int i = 0 ; i < miningSchemaI . numAttributes ( ) ; i ++ ) { Attribute tempA = miningSchemaI . attribute ( i ) ; if ( tempA . isString ( ) ) { ArrayList < String > valueVector = new ArrayList < String > ( ) ; for ( int j = 0 ; j < tempA . numValues ( ) ; j ++ ) { valueVector . add ( tempA . value ( j ) ) ; } Attribute newAtt = new Attribute ( tempA . name ( ) , valueVector ) ; attInfo . add ( newAtt ) ; } else { attInfo . add ( tempA ) ; } } Instances newI = new Instances ( "miningSchema" , attInfo , 0 ) ; if ( m_fieldInstancesStructure . classIndex ( ) >= 0 ) { newI . setClassIndex ( m_fieldInstancesStructure . classIndex ( ) ) ; } m_fieldInstancesStructure = newI ; } }
target:  Method to convert any string attributes in the mining schema Instances to nominal attributes. This may be necessary if there are no Value elements defined for categorical fields in the data dictionary. In this case, elements in the actual model definition will probably reveal the valid values for categorical fields.