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. @param newNumericFeatures the list of new numeric features to use
(List<Vec> newNumericFeatures)
| 224 | * @param newNumericFeatures the list of new numeric features to use |
| 225 | */ |
| 226 | public void replaceNumericFeatures(List<Vec> newNumericFeatures) |
| 227 | { |
| 228 | if(this.getSampleSize() != newNumericFeatures.size()) |
| 229 | throw new RuntimeException("Input list does not have the same not of dataums as the dataset"); |
| 230 | |
| 231 | for(int i = 0; i < newNumericFeatures.size(); i++) |
| 232 | { |
| 233 | DataPoint dp_i = getDataPoint(i); |
| 234 | setDataPoint(i, new DataPoint(newNumericFeatures.get(i), dp_i.getCategoricalValues(), dp_i.getCategoricalData(), dp_i.getWeight())); |
| 235 | } |
| 236 | |
| 237 | this.numNumerVals = getDataPoint(0).numNumericalValues(); |
| 238 | if (this.numericalVariableNames != null) |
| 239 | { |
| 240 | this.numericalVariableNames.clear(); |
| 241 | for (int i = 0; i < getNumNumericalVars(); i++) |
| 242 | numericalVariableNames.add("TN" + (i + 1)); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | /** |
| 247 | * Returns the <tt>i</tt>'th data point in this set. The order will never |
no test coverage detected