Generates a linearly separable binary classification problem @param dataSetSize the number of points to generated @param rand the source of randomness @return a binary classification data set that is linearly separable
(int dataSetSize, Random rand)
| 33 | * @return a binary classification data set that is linearly separable |
| 34 | */ |
| 35 | public static ClassificationDataSet get2ClassLinear(int dataSetSize, Random rand) |
| 36 | { |
| 37 | ClassificationDataSet train = new ClassificationDataSet(c2l_m0.length(), new CategoricalData[0], new CategoricalData(2)); |
| 38 | |
| 39 | for(Vec s : c2l_c0.sample(dataSetSize, rand)) |
| 40 | train.addDataPoint(s, new int[0], 0); |
| 41 | for(Vec s : c2l_c1.sample(dataSetSize, rand)) |
| 42 | train.addDataPoint(s, new int[0], 1); |
| 43 | |
| 44 | return train; |
| 45 | } |
| 46 | |
| 47 | |
| 48 | /** |
no test coverage detected