public static FactorExtraTrees getData2(int ndata, int ndim, int ntasks) {
		if (ndim<2) {
			ndim = 2;
		}
		
		int[] output = new int[ndata];
		int[] tasks  = new int[ndata];
		double[] v   = new double[ndata*ndim];
		for (int i=0; i<v.length; i++) {
			v[i] = Math.random();
		}
		Matrix m = new Matrix(v, ndata, ndim);
		for (int i=0; i<ndata; i++) {
			tasks[i]  = i%ntasks;
			if (m.get(i, 0) < 0.5) {
				if (tasks[i]%2==0) {
					// type 1 task:
					output[i] = Math.random()<0.05  ?1  :0;
				} else {
					// type 2 task:
					output[i] = Math.random()<0.95  ?1  :0;
				}
			} else {
				// independeng of task:
				output[i] = m.get(i,1)<0.5  ?1  :0;
				
			}
		}
		return new FactorExtraTrees(m, output, tasks);
	}