Creates a new Regression problem of the for x 2 +c sin(x 2 ) = y. It is meant to be an easy test case for non-linear regression algorithms. @param dataSetSize the number of data points to generate @param rand the source of randomness @return a new regression data set
(int dataSetSize, Random rand)
| 163 | * @return a new regression data set |
| 164 | */ |
| 165 | public static RegressionDataSet getSimpleRegression1(int dataSetSize, Random rand) |
| 166 | { |
| 167 | RegressionDataSet rds = new RegressionDataSet(2, new CategoricalData[0]); |
| 168 | for(int i = 0; i < dataSetSize; i++) |
| 169 | { |
| 170 | Vec s = new DenseVector(new double[]{rand.nextDouble()*4, rand.nextDouble()*4}); |
| 171 | rds.addDataPoint(s, new int[0], s.get(0)+4*Math.cos(s.get(1))); |
| 172 | } |
| 173 | return rds; |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * Returns a classification problem with small uniform noise where there is |
no test coverage detected