Changeset 2357 for trunk/sources
- Timestamp:
- 09/15/09 14:07:34 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Modeling/3.2/SimpleAccuracyEvaluator.cs
r2351 r2357 51 51 52 52 for (int sample = 0; sample < nSamples; sample++) { 53 double est = values[sample, 0];54 double origClass = values[sample, 1];53 double est = values[sample, ESTIMATION_INDEX]; 54 double origClass = values[sample, ORIGINAL_INDEX]; 55 55 double estClass = double.NaN; 56 56 // if estimation is lower than the smallest threshold value -> estimated class is the lower class … … 75 75 int n = values.GetLength(0); 76 76 double[] original = new double[n]; 77 for (int i = 0; i < n; i++) original[i] = values[i, 1];77 for (int i = 0; i < n; i++) original[i] = values[i, ORIGINAL_INDEX]; 78 78 return original.OrderBy(x => x).Distinct().ToArray(); 79 79 } -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleConfusionMatrixEvaluator.cs
r2351 r2357 25 25 namespace HeuristicLab.Modeling { 26 26 public class SimpleConfusionMatrixEvaluator : OperatorBase { 27 protected const int ORIGINAL_INDEX = 0; 28 protected const int ESTIMATION_INDEX = 1; 27 29 public override string Description { 28 30 get { … … 55 57 int[,] confusionMatrix = new int[classes.Length, classes.Length]; 56 58 for (int sample = 0; sample < nSamples; sample++) { 57 double est = values[sample, 0];58 double origClass = values[sample, 1];59 double est = values[sample, ESTIMATION_INDEX]; 60 double origClass = values[sample, ORIGINAL_INDEX]; 59 61 int estClassIndex = -1; 60 62 // if estimation is lower than the smallest threshold value -> estimated class is the lower class -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleEvaluatorBase.cs
r2226 r2357 9 9 namespace HeuristicLab.Modeling { 10 10 public abstract class SimpleEvaluatorBase : OperatorBase { 11 protected const int ORIGINAL_INDEX = 0; 12 protected const int ESTIMATION_INDEX = 1; 13 11 14 public virtual string OutputVariableName { 12 15 get { return "Quality"; } -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleMSEEvaluator.cs
r2136 r2357 28 28 double cnt = 0; 29 29 for (int i = 0; i < values.GetLength(0); i++) { 30 double estimated = values[i, 0];31 double target = values[i, 1];30 double estimated = values[i, ESTIMATION_INDEX]; 31 double target = values[i, ORIGINAL_INDEX]; 32 32 if (!double.IsNaN(estimated) && !double.IsInfinity(estimated) && 33 33 !double.IsNaN(target) && !double.IsInfinity(target)) { -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleMeanAbsolutePercentageErrorEvaluator.cs
r2136 r2357 50 50 int n = 0; 51 51 for (int i = 0; i < values.GetLength(0); i++) { 52 double estimated = values[i, 0];53 double original = values[i, 1];52 double estimated = values[i, ESTIMATION_INDEX]; 53 double original = values[i, ORIGINAL_INDEX]; 54 54 55 55 if (!double.IsNaN(estimated) && !double.IsInfinity(estimated) && -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleMeanAbsolutePercentageOfRangeErrorEvaluator.cs
r2324 r2357 51 51 // copy to one-dimensional array for range calculation 52 52 double[] originalValues = new double[values.GetLength(0)]; 53 for (int i = 0; i < originalValues.Length; i++) originalValues[i] = values[i, 1];53 for (int i = 0; i < originalValues.Length; i++) originalValues[i] = values[i, ORIGINAL_INDEX]; 54 54 double range = Statistics.Range(originalValues); 55 55 if (double.IsInfinity(range)) throw new ArgumentException("Range of elements in values is infinity"); … … 57 57 58 58 for (int i = 0; i < values.GetLength(0); i++) { 59 double estimated = values[i, 0];60 double original = values[i, 1];59 double estimated = values[i, ESTIMATION_INDEX]; 60 double original = values[i, ORIGINAL_INDEX]; 61 61 62 62 if (!double.IsNaN(estimated) && !double.IsInfinity(estimated) && -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleR2Evaluator.cs
r2136 r2357 30 30 double cnt = 0; 31 31 for (int i = 0; i < values.GetLength(0); i++) { 32 double estimated = values[i, 0];33 double target = values[i, 1];32 double estimated = values[i, ESTIMATION_INDEX]; 33 double target = values[i, ORIGINAL_INDEX]; 34 34 if (!double.IsNaN(estimated) && !double.IsInfinity(estimated) && 35 35 !double.IsNaN(target) && !double.IsInfinity(target)) { … … 46 46 double targetDeviationTotalSumOfSquares = 0; 47 47 for (int i = 0; i < values.GetLength(0); i++) { 48 double target = values[i, 1];48 double target = values[i, ORIGINAL_INDEX]; 49 49 if (!double.IsNaN(target) && !double.IsInfinity(target)) { 50 50 target = target - targetMean; -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleTheilInequalityCoefficientEvaluator.cs
r2349 r2357 57 57 int nSamples = 0; 58 58 for (int sample = 1; sample < n; sample++) { 59 double prevValue = values[sample - 1, 1];60 double estimatedChange = values[sample, 0] - prevValue;61 double originalChange = values[sample, 1] - prevValue;59 double prevValue = values[sample - 1, ORIGINAL_INDEX]; 60 double estimatedChange = values[sample, ESTIMATION_INDEX] - prevValue; 61 double originalChange = values[sample, ORIGINAL_INDEX] - prevValue; 62 62 if (!double.IsNaN(originalChange) && !double.IsInfinity(originalChange)) { 63 63 double error = estimatedChange - originalChange; -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleVarianceAccountedForEvaluator.cs
r2324 r2357 57 57 double[] originalTargetVariableValues = new double[n]; 58 58 for (int i = 0; i < n; i++) { 59 double estimated = values[i, 0];60 double original = values[i, 1];59 double estimated = values[i, ESTIMATION_INDEX]; 60 double original = values[i, ORIGINAL_INDEX]; 61 61 if (!double.IsNaN(estimated) && !double.IsInfinity(estimated) && 62 62 !double.IsNaN(original) && !double.IsInfinity(original)) { -
trunk/sources/HeuristicLab.Modeling/3.2/VariableQualityImpactCalculator.cs
r2319 r2357 87 87 double[] targetValues = dataset.GetVariableValues(targetVariableName, start, end); 88 88 89 double oldMSE = CalculateMSE( predictedValues, targetValues);89 double oldMSE = CalculateMSE(targetValues, predictedValues); 90 90 double newMSE; 91 91 -
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorEvaluator.cs
r2349 r2357 60 60 double[,] values = new double[scaledProblem.Count, 2]; 61 61 for (int i = 0; i < scaledProblem.Count; i++) { 62 values[i, 0] = SVM.Prediction.Predict(modelData.Model, scaledProblem.X[i]);63 values[i, 1] = dataset.GetValue(start + i, targetVariable);62 values[i, 0] = dataset.GetValue(start + i, targetVariable); 63 values[i, 1] = SVM.Prediction.Predict(modelData.Model, scaledProblem.X[i]); 64 64 } 65 65
Note: See TracChangeset
for help on using the changeset viewer.