Hi there,
I think there is a bug in ParameterIteration. When I use logarithmic scaling I get the following results:
Min = 2, Max = 8, Steps = 2 gives 2, 3.646, 8 where I’d expect 2, 4, 8
Min = 0.125, Max = 1, Steps = 3 gives 0.125, 0.358, 0.646, 1 where I’d expect 0.125, 0.25, 0.5, 1
This is the code producing the sequence:
package com.rapidminer.parameter.value. ParameterValueGrid
…
private double[] scaleLogarithmic(int steps) {
double[] values = new double[steps + 1];
double offset = 1 - min;
for (int i = 0; i < steps + 1; i++) {
values = Math.pow(max + offset, (double) i / (double) steps) - offset;
}
return values;
}
Here, the distance between the individual values is independent of the position of the interval. I think that’s wrong. This is the fix I propose:
private double[] scaleLogarithmic(int steps) {
double[] values = new double[steps + 1];
double factor = 1 / min; //TODO: Make sure min > 0
for (int i = 0; i < steps + 1; i++) {
values = Math.pow(max * factor, (double) i / (double) steps) / factor;
}
return values;
}
Regards,
Peter