Changeset 2379 for trunk/sources/HeuristicLab.Modeling
- Timestamp:
- 09/23/09 13:35:55 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Modeling/3.2
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Modeling/3.2/DefaultRegressionOperators.cs
r2372 r2379 60 60 testMseEvaluator.GetVariableInfo("MSE").ActualName = ModelingResult.TestMeanSquaredError.ToString(); 61 61 testMseEvaluator.GetVariableInfo("Values").ActualName = "TestValues"; 62 #endregion 63 #region NMSE 64 SimpleNMSEEvaluator trainingNmseEvaluator = new SimpleNMSEEvaluator(); 65 trainingNmseEvaluator.Name = "TrainingNmseEvaluator"; 66 trainingNmseEvaluator.GetVariableInfo("NMSE").ActualName = ModelingResult.TrainingNormalizedMeanSquaredError.ToString(); 67 trainingNmseEvaluator.GetVariableInfo("Values").ActualName = "TrainingValues"; 68 SimpleNMSEEvaluator validationNmseEvaluator = new SimpleNMSEEvaluator(); 69 validationNmseEvaluator.Name = "ValidationMseEvaluator"; 70 validationNmseEvaluator.GetVariableInfo("NMSE").ActualName = ModelingResult.ValidationNormalizedMeanSquaredError.ToString(); 71 validationNmseEvaluator.GetVariableInfo("Values").ActualName = "ValidationValues"; 72 SimpleNMSEEvaluator testNmseEvaluator = new SimpleNMSEEvaluator(); 73 testNmseEvaluator.Name = "TestNmseEvaluator"; 74 testNmseEvaluator.GetVariableInfo("NMSE").ActualName = ModelingResult.TestNormalizedMeanSquaredError.ToString(); 75 testNmseEvaluator.GetVariableInfo("Values").ActualName = "TestValues"; 62 76 #endregion 63 77 #region MAPE … … 121 135 seq.AddSubOperator(validationMseEvaluator); 122 136 seq.AddSubOperator(testMseEvaluator); 137 seq.AddSubOperator(trainingNmseEvaluator); 138 seq.AddSubOperator(validationNmseEvaluator); 139 seq.AddSubOperator(testNmseEvaluator); 123 140 seq.AddSubOperator(trainingMapeEvaluator); 124 141 seq.AddSubOperator(validationMapeEvaluator); … … 167 184 model.ExtractResult(modelScope, ModelingResult.ValidationMeanSquaredError); 168 185 model.ExtractResult(modelScope, ModelingResult.TestMeanSquaredError); 186 model.ExtractResult(modelScope, ModelingResult.TrainingNormalizedMeanSquaredError); 187 model.ExtractResult(modelScope, ModelingResult.ValidationNormalizedMeanSquaredError); 188 model.ExtractResult(modelScope, ModelingResult.TestNormalizedMeanSquaredError); 169 189 model.ExtractResult(modelScope, ModelingResult.TrainingMeanAbsolutePercentageError); 170 190 model.ExtractResult(modelScope, ModelingResult.ValidationMeanAbsolutePercentageError); -
trunk/sources/HeuristicLab.Modeling/3.2/DefaultTimeSeriesOperators.cs
r2370 r2379 45 45 seq.AddSubOperator(DefaultRegressionOperators.CreatePostProcessingOperator()); 46 46 47 #region theil inequality 47 48 SimpleTheilInequalityCoefficientEvaluator trainingTheil = new SimpleTheilInequalityCoefficientEvaluator(); 48 49 trainingTheil.Name = "TrainingTheilInequalityEvaluator"; … … 61 62 seq.AddSubOperator(validationTheil); 62 63 seq.AddSubOperator(testTheil); 64 #endregion 65 66 #region directional symmetry 67 SimpleDirectionalSymmetryEvaluator trainingDS = new SimpleDirectionalSymmetryEvaluator(); 68 trainingDS.Name = "TrainingDirectionalSymmetryEvaluator"; 69 trainingDS.GetVariableInfo("Values").ActualName = "TrainingValues"; 70 trainingDS.GetVariableInfo("DirectionalSymmetry").ActualName = ModelingResult.TrainingDirectionalSymmetry.ToString(); 71 SimpleDirectionalSymmetryEvaluator validationDS = new SimpleDirectionalSymmetryEvaluator(); 72 validationDS.Name = "ValidationDirectionalSymmetryEvaluator"; 73 validationDS.GetVariableInfo("Values").ActualName = "ValidationValues"; 74 validationDS.GetVariableInfo("DirectionalSymmetry").ActualName = ModelingResult.ValidationDirectionalSymmetry.ToString(); 75 SimpleDirectionalSymmetryEvaluator testDS = new SimpleDirectionalSymmetryEvaluator(); 76 testDS.Name = "TestDirectionalSymmetryEvaluator"; 77 testDS.GetVariableInfo("Values").ActualName = "TestValues"; 78 testDS.GetVariableInfo("DirectionalSymmetry").ActualName = ModelingResult.TestDirectionalSymmetry.ToString(); 79 80 seq.AddSubOperator(trainingDS); 81 seq.AddSubOperator(validationDS); 82 seq.AddSubOperator(testDS); 83 #endregion 84 85 #region weighted directional symmetry 86 SimpleWeightedDirectionalSymmetryEvaluator trainingWDS = new SimpleWeightedDirectionalSymmetryEvaluator(); 87 trainingWDS.Name = "TrainingWeightedDirectionalSymmetryEvaluator"; 88 trainingWDS.GetVariableInfo("Values").ActualName = "TrainingValues"; 89 trainingWDS.GetVariableInfo("WeightedDirectionalSymmetry").ActualName = ModelingResult.TrainingWeightedDirectionalSymmetry.ToString(); 90 SimpleWeightedDirectionalSymmetryEvaluator validationWDS = new SimpleWeightedDirectionalSymmetryEvaluator(); 91 validationWDS.Name = "ValidationWeightedDirectionalSymmetryEvaluator"; 92 validationWDS.GetVariableInfo("Values").ActualName = "ValidationValues"; 93 validationWDS.GetVariableInfo("WeightedDirectionalSymmetry").ActualName = ModelingResult.ValidationWeightedDirectionalSymmetry.ToString(); 94 SimpleWeightedDirectionalSymmetryEvaluator testWDS = new SimpleWeightedDirectionalSymmetryEvaluator(); 95 testWDS.Name = "TestWeightedDirectionalSymmetryEvaluator"; 96 testWDS.GetVariableInfo("Values").ActualName = "TestValues"; 97 testWDS.GetVariableInfo("WeightedDirectionalSymmetry").ActualName = ModelingResult.TestWeightedDirectionalSymmetry.ToString(); 98 99 seq.AddSubOperator(trainingWDS); 100 seq.AddSubOperator(validationWDS); 101 seq.AddSubOperator(testWDS); 102 #endregion 63 103 64 104 op.OperatorGraph.AddOperator(seq); … … 72 112 model.ExtractResult(modelScope, ModelingResult.ValidationTheilInequality); 73 113 model.ExtractResult(modelScope, ModelingResult.TestTheilInequality); 114 model.ExtractResult(modelScope, ModelingResult.TrainingDirectionalSymmetry); 115 model.ExtractResult(modelScope, ModelingResult.ValidationDirectionalSymmetry); 116 model.ExtractResult(modelScope, ModelingResult.TestDirectionalSymmetry); 117 model.ExtractResult(modelScope, ModelingResult.TrainingWeightedDirectionalSymmetry); 118 model.ExtractResult(modelScope, ModelingResult.ValidationWeightedDirectionalSymmetry); 119 model.ExtractResult(modelScope, ModelingResult.TestWeightedDirectionalSymmetry); 74 120 model.Type = ModelType.TimeSeriesPrognosis; 75 121 return model; -
trunk/sources/HeuristicLab.Modeling/3.2/HeuristicLab.Modeling-3.2.csproj
r2370 r2379 84 84 <Compile Include="AnalyzerModel.cs" /> 85 85 <Compile Include="BestSolutionStorer.cs" /> 86 <Compile Include="SimpleWeightedDirectionalSymmetryEvaluator.cs" /> 87 <Compile Include="SimpleDirectionalSymmetryEvaluator.cs" /> 88 <Compile Include="SimpleNMSEEvaluator.cs" /> 86 89 <Compile Include="ModelingResult.cs" /> 87 90 <Compile Include="ModelType.cs" /> -
trunk/sources/HeuristicLab.Modeling/3.2/MatrixCreator.cs
r2313 r2379 25 25 26 26 namespace HeuristicLab.Modeling { 27 public class Matrix Creator<T> {28 public static T[,] Create Matrix(T[] first, T[] second) {27 public class Matrix<T> { 28 public static T[,] Create(T[] first, T[] second) { 29 29 if (first.Length != second.Length) 30 30 throw new ArgumentException("Both arrays must be of same length."); 31 T[,] array = new T[first.Length, 2];31 T[,] array = new T[first.Length, 2]; 32 32 for (int i = 0; i < first.Length; i++) { 33 33 array[i, 0] = first[i]; … … 36 36 return array; 37 37 } 38 39 public static T[] GetColumn(T[,] matrix, int column) { 40 if (column >= matrix.GetLength(1)) throw new ArgumentException("Invalid column index: " + column + ". Matrix has only " + matrix.GetLength(1) + " columns."); 41 T[] result = new T[matrix.GetLength(0)]; 42 for (int i = 0; i < result.Length; i++) { 43 result[i] = matrix[i, column]; 44 } 45 return result; 46 } 38 47 } 39 48 } -
trunk/sources/HeuristicLab.Modeling/3.2/ModelingResult.cs
r2370 r2379 27 27 TestMeanSquaredError, 28 28 29 TrainingNormalizedMeanSquaredError, 30 ValidationNormalizedMeanSquaredError, 31 TestNormalizedMeanSquaredError, 32 29 33 TrainingMeanAbsolutePercentageError, 30 34 ValidationMeanAbsolutePercentageError, … … 51 55 TestTheilInequality, 52 56 57 TrainingDirectionalSymmetry, 58 ValidationDirectionalSymmetry, 59 TestDirectionalSymmetry, 60 61 TrainingWeightedDirectionalSymmetry, 62 ValidationWeightedDirectionalSymmetry, 63 TestWeightedDirectionalSymmetry, 64 53 65 VariableQualityImpact, 54 66 VariableEvaluationImpact -
trunk/sources/HeuristicLab.Modeling/3.2/VariableEvaluationImpactCalculator.cs
r2374 r2379 114 114 private static double CalculateVAF(double[] referenceValues, double[] newValues) { 115 115 try { 116 return SimpleVarianceAccountedForEvaluator.Calculate(Matrix Creator<double>.CreateMatrix(referenceValues, newValues));116 return SimpleVarianceAccountedForEvaluator.Calculate(Matrix<double>.Create(referenceValues, newValues)); 117 117 } 118 118 catch (ArgumentException) { -
trunk/sources/HeuristicLab.Modeling/3.2/VariableQualityImpactCalculator.cs
r2374 r2379 122 122 private static double CalculateMSE(double[] referenceValues, double[] newValues) { 123 123 try { 124 return SimpleMSEEvaluator.Calculate(Matrix Creator<double>.CreateMatrix(referenceValues, newValues));124 return SimpleMSEEvaluator.Calculate(Matrix<double>.Create(referenceValues, newValues)); 125 125 } 126 126 catch (ArgumentException) {
Note: See TracChangeset
for help on using the changeset viewer.