public void replaceNumericFeatures ( List < Vec > newNumericFeatures ) { if ( this . size ( ) != newNumericFeatures . size ( ) ) throw new RuntimeException ( "Input list does not have the same not of dataums as the dataset" ) ; for ( int i = 0 ; i < newNumericFeatures . size ( ) ; i ++ ) { DataPoint dp_i = getDataPoint ( i ) ; setDataPoint ( i , new DataPoint ( newNumericFeatures . get ( i ) , dp_i . getCategoricalValues ( ) , dp_i . getCategoricalData ( ) ) ) ; } this . numNumerVals = getDataPoint ( 0 ) . numNumericalValues ( ) ; if ( this . numericalVariableNames != null ) this . numericalVariableNames . clear ( ) ; }
This method will replace every numeric feature in this dataset with a Vec object from the given list . All vecs in the given list must be of the same size .