Creates a new data set from the given sample counts. Points sampled multiple times will have multiple entries in the data set. @param dataSet the data set that was sampled from @param sampledCounts the sampling values obtained from #sampleWithReplacement(int[], int, java.util.Random) @retur
(ClassificationDataSet dataSet, int[] sampledCounts)
| 286 | * @return a new sampled classification data set |
| 287 | */ |
| 288 | public static ClassificationDataSet getSampledDataSet(ClassificationDataSet dataSet, int[] sampledCounts) |
| 289 | { |
| 290 | ClassificationDataSet destination = new ClassificationDataSet(dataSet.getNumNumericalVars(), dataSet.getCategories(), dataSet.getPredicting()); |
| 291 | |
| 292 | for (int i = 0; i < sampledCounts.length; i++) |
| 293 | for(int j = 0; j < sampledCounts[i]; j++) |
| 294 | { |
| 295 | DataPoint dp = dataSet.getDataPoint(i); |
| 296 | destination.addDataPoint(dp.getNumericalValues(), dp.getCategoricalValues(), dataSet.getDataPointCategory(i)); |
| 297 | } |
| 298 | |
| 299 | return destination; |
| 300 | } |
| 301 | |
| 302 | /** |
| 303 | * Creates a new data set from the given sample counts. Points sampled |
no test coverage detected