parent
f43e575b18
commit
d170727f8e
@ -6,6 +6,8 @@ import eva2.optimization.enums.StatisticsOnTwoSampledData;
|
|||||||
import eva2.tools.ReflectPackage;
|
import eva2.tools.ReflectPackage;
|
||||||
import eva2.tools.StringTools;
|
import eva2.tools.StringTools;
|
||||||
import eva2.tools.math.Mathematics;
|
import eva2.tools.math.Mathematics;
|
||||||
|
import org.apache.commons.math3.stat.ranking.NaNStrategy;
|
||||||
|
import org.apache.commons.math3.stat.ranking.TiesStrategy;
|
||||||
|
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -255,15 +257,19 @@ public class EvAStatisticalEvaluation {
|
|||||||
private static String calculateMannWhitney(String field, OptimizationJob job1, OptimizationJob job2) {
|
private static String calculateMannWhitney(String field, OptimizationJob job1, OptimizationJob job2) {
|
||||||
double[] dat1 = job1.getDoubleDataColumn(field);
|
double[] dat1 = job1.getDoubleDataColumn(field);
|
||||||
double[] dat2 = job2.getDoubleDataColumn(field);
|
double[] dat2 = job2.getDoubleDataColumn(field);
|
||||||
|
org.apache.commons.math3.stat.inference.MannWhitneyUTest mU = new org.apache.commons.math3.stat.inference.MannWhitneyUTest(NaNStrategy.FAILED, TiesStrategy.AVERAGE);
|
||||||
double t = Double.NaN;
|
double t = Double.NaN;
|
||||||
if (dat1 != null && dat2 != null) {
|
if (dat1 != null && dat2 != null) {
|
||||||
|
|
||||||
|
return "" + mU.mannWhitneyUTest(dat1, dat2);
|
||||||
|
/*
|
||||||
Object obj = ReflectPackage.instantiateWithParams("jsc.independentsamples.MannWhitneyTest", new Object[]{dat1, dat2}, null);
|
Object obj = ReflectPackage.instantiateWithParams("jsc.independentsamples.MannWhitneyTest", new Object[]{dat1, dat2}, null);
|
||||||
if (obj != null) {
|
if (obj != null) {
|
||||||
Object sp = BeanInspector.callIfAvailable(obj, "getSP", new Object[]{});
|
Object sp = BeanInspector.callIfAvailable(obj, "getSP", new Object[]{});
|
||||||
t = (Double) sp;
|
t = (Double) sp;
|
||||||
} else {
|
} else {
|
||||||
LOGGER.warning("For the MannWhitney test, the JSC package is required on the class path!");
|
LOGGER.warning("For the MannWhitney test, the JSC package is required on the class path!");
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
return "" + t;
|
return "" + t;
|
||||||
}
|
}
|
||||||
@ -308,9 +314,9 @@ public class EvAStatisticalEvaluation {
|
|||||||
assert(uA + uB == n1 * n2);
|
assert(uA + uB == n1 * n2);
|
||||||
double u = Math.min(uA, uB);
|
double u = Math.min(uA, uB);
|
||||||
double mU = (n1 * n2) / 2;
|
double mU = (n1 * n2) / 2;
|
||||||
double omegaU = Math.sqrt((n1*n2*(n1 + n2 + 1.0))/12.0);
|
double sigmaU = Math.sqrt((n1*n2*(n1 + n2 + 1.0))/12.0);
|
||||||
|
|
||||||
t = (u - mU) / omegaU;
|
t = (u - mU) / sigmaU;
|
||||||
}
|
}
|
||||||
return "" + t;
|
return "" + t;
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ package eva2.problems;
|
|||||||
*/
|
*/
|
||||||
public abstract class AbstractProblemDoubleOffset extends AbstractProblemDouble implements Interface2DBorderProblem {
|
public abstract class AbstractProblemDoubleOffset extends AbstractProblemDouble implements Interface2DBorderProblem {
|
||||||
|
|
||||||
protected int problemDimension = 10;
|
|
||||||
protected double xOffset = 0.0; // TODO make them private, implement evaluate() and create abstract evalWithoutOffsets
|
protected double xOffset = 0.0; // TODO make them private, implement evaluate() and create abstract evalWithoutOffsets
|
||||||
protected double yOffset = 0.0;
|
protected double yOffset = 0.0;
|
||||||
|
|
||||||
|
@ -20,15 +20,12 @@ import java.util.ArrayList;
|
|||||||
*/
|
*/
|
||||||
@Description("T1 is to be minimized.")
|
@Description("T1 is to be minimized.")
|
||||||
public class TF1Problem extends AbstractMultiObjectiveOptimizationProblem implements java.io.Serializable {
|
public class TF1Problem extends AbstractMultiObjectiveOptimizationProblem implements java.io.Serializable {
|
||||||
protected int problemDimension = 30;
|
|
||||||
protected int outputDimension = 2;
|
protected int outputDimension = 2;
|
||||||
protected double noise = 0.0;
|
protected double noise = 0.0;
|
||||||
protected double xOffset = 0.0;
|
protected double xOffset = 0.0;
|
||||||
protected double yOffset = 0.0;
|
protected double yOffset = 0.0;
|
||||||
protected boolean applyConstraints = false;
|
protected boolean applyConstraints = false;
|
||||||
|
|
||||||
// transient private GraphPointSet mySet;
|
|
||||||
|
|
||||||
public TF1Problem() {
|
public TF1Problem() {
|
||||||
super(1.);
|
super(1.);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user