- Timestamp:
- 03/15/11 08:25:27 (14 years ago)
- Location:
- branches/DataAnalysis Refactoring
- Files:
-
- 5 added
- 118 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis.Views/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabAlgorithmsDataAnalysisViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis.Views/3.4
- Property svn:ignore
-
old new 2 2 obj 3 3 HeuristicLabAlgorithmsDataAnalysisViewsPlugin.cs 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.3
- Property svn:ignore
-
old new 3 3 HeuristicLabAlgorithmsDataAnalysisPlugin.cs 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:ignore
-
old new 3 3 HeuristicLabAlgorithmsDataAnalysisPlugin.cs 4 4 HeuristicLab.Algorithms.DataAnalysis-3.4.csproj.user 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs
r5680 r5681 120 120 IEnumerable<int> rows) { 121 121 string targetVariable = problemData.TargetVariable; 122 List<double> originalClasses = problemData.ClassValues.ToList(); 123 int nClasses = problemData.Classes; 124 List<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, rows).ToList(); 125 double maxEstimatedValue = estimatedValues.Max(); 126 double minEstimatedValue = estimatedValues.Min(); 127 var estimatedTargetValues = 128 (from row in problemData.TrainingIndizes 129 select new { EstimatedValue = estimatedValues[row], TargetValue = problemData.Dataset[targetVariable, row] }) 130 .ToList(); 122 var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, rows); 123 var targetClassValues = problemData.Dataset.GetEnumeratedVariableValues(targetVariable, rows); 131 124 132 Dictionary<double, double> classMean = new Dictionary<double, double>(); 133 Dictionary<double, double> classStdDev = new Dictionary<double, double>(); 134 // calculate moments per class 135 foreach (var classValue in originalClasses) { 136 var estimatedValuesForClass = from x in estimatedTargetValues 137 where x.TargetValue == classValue 138 select x.EstimatedValue; 139 double mean, variance; 140 OnlineMeanAndVarianceCalculator.Calculate(estimatedValuesForClass, out mean, out variance); 141 classMean[classValue] = mean; 142 classStdDev[classValue] = Math.Sqrt(variance); 143 } 144 List<double> thresholds = new List<double>(); 145 for (int i = 0; i < nClasses - 1; i++) { 146 for (int j = i + 1; j < nClasses; j++) { 147 double x1, x2; 148 double class0 = originalClasses[i]; 149 double class1 = originalClasses[j]; 150 // calculate all thresholds 151 CalculateCutPoints(classMean[class0], classStdDev[class0], classMean[class1], classStdDev[class1], out x1, out x2); 152 if (!thresholds.Any(x => x.IsAlmost(x1))) thresholds.Add(x1); 153 if (!thresholds.Any(x => x.IsAlmost(x2))) thresholds.Add(x2); 154 } 155 } 156 thresholds.Sort(); 157 thresholds.Insert(0, double.NegativeInfinity); 158 thresholds.Add(double.PositiveInfinity); 159 List<double> classValues = new List<double>(); 160 for (int i = 0; i < thresholds.Count - 1; i++) { 161 double m; 162 if (double.IsNegativeInfinity(thresholds[i])) { 163 m = thresholds[i + 1] - 1.0; 164 } else if (double.IsPositiveInfinity(thresholds[i + 1])) { 165 m = thresholds[i] + 1.0; 166 } else { 167 m = thresholds[i] + (thresholds[i + 1] - thresholds[i]) / 2.0; 168 } 169 170 double maxDensity = 0; 171 double maxDensityClassValue = -1; 172 foreach (var classValue in originalClasses) { 173 double density = NormalDensity(m, classMean[classValue], classStdDev[classValue]); 174 if (density > maxDensity) { 175 maxDensity = density; 176 maxDensityClassValue = classValue; 177 } 178 } 179 classValues.Add(maxDensityClassValue); 180 } 181 List<double> filteredThresholds = new List<double>(); 182 List<double> filteredClassValues = new List<double>(); 183 filteredThresholds.Add(thresholds[0]); 184 filteredClassValues.Add(classValues[0]); 185 for (int i = 0; i < classValues.Count - 1; i++) { 186 if (classValues[i] != classValues[i + 1]) { 187 filteredThresholds.Add(thresholds[i + 1]); 188 filteredClassValues.Add(classValues[i + 1]); 189 } 190 } 191 filteredThresholds.Add(double.PositiveInfinity); 192 193 return new SymbolicDiscriminantFunctionClassificationModel(tree, interpreter, filteredClassValues, filteredThresholds); 194 } 195 196 private static double NormalDensity(double x, double mu, double sigma) { 197 return (1.0 / Math.Sqrt(2.0 * Math.PI * sigma * sigma)) * Math.Exp(-((x - mu) * (x - mu)) / (2.0 * sigma * sigma)); 198 } 199 200 private static void CalculateCutPoints(double m1, double s1, double m2, double s2, out double x1, out double x2) { 201 double a = (s1 * s1 - s2 * s2); 202 x1 = -(-m2 * s1 * s1 + m1 * s2 * s2 + Math.Sqrt(s1 * s1 * s2 * s2 * ((m1 - m2) * (m1 - m2) + 2.0 * (-s1 * s1 + s2 * s2) * Math.Log(s2 / s1)))) / a; 203 x2 = (m2 * s1 * s1 - m1 * s2 * s2 + Math.Sqrt(s1 * s1 * s2 * s2 * ((m1 - m2) * (m1 - m2) + 2.0 * (-s1 * s1 + s2 * s2) * Math.Log(s2 / s1)))) / a; 125 double[] classValues; 126 double[] thresholds; 127 NormalDistributionCutPointsThresholdCalculator.CalculateThresholds(problemData, estimatedValues, targetClassValues, out classValues, out thresholds); 128 return new SymbolicDiscriminantFunctionClassificationModel(tree, interpreter, classValues, thresholds); 204 129 } 205 130 } -
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.EvolutionStrategy/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabAlgorithmsEvolutionStrategyPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.GeneticAlgorithm/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabAlgorithmsGeneticAlgorithmPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.LocalSearch/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabAlgorithmsLocalSearchPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.NSGA2/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabAlgorithmsNSGA2Plugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabAlgorithmsOffspringSelectionGeneticAlgorithmPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3
- Property svn:ignore
-
old new 4 4 *.user 5 5 *.suo 6 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.SimulatedAnnealing/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabAlgorithmsSimulatedAnnealingPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.TabuSearch/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabAlgorithmsTabuSearchPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Analysis.Views/3.3
- Property svn:ignore
-
old new 3 3 HeuristicLabAnalysisViewsPlugin.cs 4 4 *.user 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Analysis/3.3
- Property svn:ignore
-
old new 3 3 HeuristicLabAnalysisPlugin.cs 4 4 *.user 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Clients.Common/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabClientsCommonPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.CodeEditor/3.3
- Property svn:ignore
-
old new 3 3 HeuristicLabCodeEditorPlugin.cs 4 4 *.user 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Collections/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabCollectionsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Common.Resources/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabCommonResourcesPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Common/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabCommonPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Core.Views/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabCoreViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Core/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabCorePlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Data.Views/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabDataViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Data/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabDataPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.DebugEngine/3.3
- Property svn:ignore
-
old new 3 3 HeuristicLabDebugEnginePlugin.cs 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Tests
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.PermutationEncoding.Views/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabEncodingsPermutationEncodingViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.PermutationEncoding/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabEncodingsPermutationEncodingPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3
- Property svn:ignore
-
old new 3 3 HeuristicLabEncodingsRealVectorEncodingPlugin.cs 4 4 *.user 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests
- Property svn:ignore
-
old new 2 2 obj 3 3 *.user 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3
- Property svn:ignore
-
old new 3 3 HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin.cs 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4
- Property svn:ignore
-
old new 2 2 obj 3 3 HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin.cs 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests
- Property svn:ignore
-
old new 2 2 obj 3 3 *.user 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
- Property svn:ignore
-
old new 3 3 HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs 4 4 *.user 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests
- Property svn:ignore
-
old new 2 2 obj 3 3 *.user 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.ALGLIB/3.1.0/ALGLIB-3.1.0
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.ALGLIB/3.1.0/HeuristicLab.ALGLIB-3.1.0
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabALGLIBPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/HeuristicLab.LibSVM-1.6.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabLibSVMPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/HeuristicLab.ProtobufCS
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabProtobufCSPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtoGen
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtoGen.Test
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers.Test
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.SharpDevelop/3.1.1.5327
- Property svn:ignore
-
old new 2 2 obj 3 3 *.user 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.WinFormsUI/2.3.1/HeuristicLab.WinFormsUI-2.3.1
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabWinFormsUIPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.WinFormsUI/2.3.1/WinFormsUI-2.3.1
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs/HeuristicLab.log4net/1.2.10.0
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.MainForm.WindowsForms/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.MainForm/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Operators.Programmable/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Operators.Views.GraphVisualization/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 *Plugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Operators.Views/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabOperatorsViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Operators/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabOperatorsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Optimization.Operators/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Optimization.Views/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 *.user 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Optimization/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 *.user 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Optimizer/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabOptimizerPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.ParallelEngine/3.3
- Property svn:ignore
-
old new 2 2 obj 3 3 HeuristicLabParallelEnginePlugin.cs 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Parameters.Views/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabParametersViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Parameters/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabParametersPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Persistence.GUI/3.3
- Property svn:ignore
-
old new 4 4 HeuristicLab.Persistence.GUI-3.3.suo 5 5 HeuristicLabPersistenceGUIPlugin.cs 6 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Persistence/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabPersistencePlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Persistence/3.3/Tests
- Property svn:ignore
-
old new 2 2 obj 3 3 *.user 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.PluginInfrastructure/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 Service References 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.ArtificialAnt.Views/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabProblemsArtificialAntViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.ArtificialAnt.Views/3.4
- Property svn:ignore
-
old new 2 2 obj 3 3 HeuristicLabProblemsArtificialAntViewsPlugin.cs 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.ArtificialAnt/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabProblemsArtificialAntPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.ArtificialAnt/3.4
- Property svn:ignore
-
old new 2 2 obj 3 3 HeuristicLabProblemsArtificialAntPlugin.cs 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Classification.Views/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Classification/3.3
- Property svn:ignore
-
old new 4 4 HeuristicLabProblemsDataAnalysisClassifcationPlugin.cs 5 5 HeuristicLabProblemsDataAnalysisClassificationPlugin.cs 6 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Regression/3.3
- Property svn:ignore
-
old new 3 3 HeuristicLabProblemsDataAnalysisRegressionPlugin.cs 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4
- Property svn:ignore
-
old new 3 3 HeuristicLabProblemsDataAnalysisSymbolicClassificationPlugin.cs 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs
r5678 r5681 74 74 var estimatedValues = SymbolicDataAnalysisTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, ProblemData.TrainingIndizes); 75 75 var targetValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes); 76 DiscriminantFunctionClassificationSolution.CalculateClassThresholds(ProblemData, estimatedValues, targetValues, out classValues, out thresholds);76 AccuracyMaximizationThresholdCalculator.CalculateThresholds(ProblemData, estimatedValues, targetValues, out classValues, out thresholds); 77 77 var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, classValues, thresholds); 78 78 return new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemData); -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer.cs
r5678 r5681 72 72 var estimatedValues = SymbolicDataAnalysisTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, ProblemData.TrainingIndizes); 73 73 var targetValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes); 74 DiscriminantFunctionClassificationSolution.CalculateClassThresholds(ProblemData, estimatedValues, targetValues, out classValues, out thresholds);74 AccuracyMaximizationThresholdCalculator.CalculateThresholds(ProblemData, estimatedValues, targetValues, out classValues, out thresholds); 75 75 var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, classValues, thresholds); 76 76 return new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemData); -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Property svn:ignore
-
old new 3 3 HeuristicLabProblemsDataAnalysisSymbolicRegressionPlugin.cs 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Property svn:ignore
-
old new 3 3 HeuristicLabProblemsDataAnalysisSymbolicPlugin.cs 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tests
- Property svn:ignore
-
old new 1 1 bin 2 2 obj 3 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabProblemsDataAnalysisViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabProblemsDataAnalysisViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.3
- Property svn:ignore
-
old new 3 3 HeuristicLabProblemsDataAnalysisPlugin.cs 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.3/Tests
- Property svn:ignore
-
old new 2 2 obj 3 3 *.user 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4
- Property svn:ignore
-
old new 3 3 HeuristicLabProblemsDataAnalysisPlugin.cs 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DiscriminantFunctionClassificationModel.cs
r5678 r5681 64 64 65 65 [StorableConstructor] 66 protected DiscriminantFunctionClassificationModel( ) : base() { }66 protected DiscriminantFunctionClassificationModel(bool deserializing) : base(deserializing) { } 67 67 protected DiscriminantFunctionClassificationModel(DiscriminantFunctionClassificationModel original, Cloner cloner) 68 68 : base(original, cloner) { -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DiscriminantFunctionClassificationSolution.cs
r5678 r5681 43 43 : base(original, cloner) { 44 44 } 45 public DiscriminantFunctionClassificationSolution(IRegressionModel model, IClassificationProblemData problemData )46 : this(new DiscriminantFunctionClassificationModel(model, problemData.ClassValues, CalculateClassThresholds(model, problemData, problemData.TrainingIndizes)), problemData) {45 public DiscriminantFunctionClassificationSolution(IRegressionModel model, IClassificationProblemData problemData, IEnumerable<double> classValues, IEnumerable<double> thresholds) 46 : this(new DiscriminantFunctionClassificationModel(model, classValues, thresholds), problemData) { 47 47 } 48 48 public DiscriminantFunctionClassificationSolution(IDiscriminantFunctionClassificationModel model, IClassificationProblemData problemData) … … 91 91 } 92 92 #endregion 93 94 private static double[] CalculateClassThresholds(IRegressionModel model, IClassificationProblemData problemData, IEnumerable<int> rows) {95 double[] thresholds;96 double[] classValues;97 CalculateClassThresholds(problemData, model.GetEstimatedValues(problemData.Dataset, rows), problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows), out classValues, out thresholds);98 return thresholds;99 }100 101 public static void CalculateClassThresholds(IClassificationProblemData problemData, IEnumerable<double> estimatedValues, IEnumerable<double> targetClassValues, out double[] classValues, out double[] thresholds) {102 int slices = 100;103 List<double> estimatedValuesList = estimatedValues.ToList();104 double maxEstimatedValue = estimatedValuesList.Max();105 double minEstimatedValue = estimatedValuesList.Min();106 double thresholdIncrement = (maxEstimatedValue - minEstimatedValue) / slices;107 var estimatedAndTargetValuePairs =108 estimatedValuesList.Zip(targetClassValues, (x, y) => new { EstimatedValue = x, TargetClassValue = y })109 .OrderBy(x => x.EstimatedValue)110 .ToList();111 112 classValues = problemData.ClassValues.OrderBy(x => x).ToArray();113 int nClasses = classValues.Length;114 thresholds = new double[nClasses + 1];115 thresholds[0] = double.NegativeInfinity;116 thresholds[thresholds.Length - 1] = double.PositiveInfinity;117 118 // incrementally calculate accuracy of all possible thresholds119 int[,] confusionMatrix = new int[nClasses, nClasses];120 121 // one threshold is always treated as binary separation of the remaining classes122 for (int i = 1; i < thresholds.Length - 1; i++) {123 double lowerThreshold = thresholds[i - 1];124 double actualThreshold = Math.Max(lowerThreshold, minEstimatedValue);125 double lowestBestThreshold = double.NaN;126 double highestBestThreshold = double.NaN;127 double bestClassificationScore = double.PositiveInfinity;128 bool seriesOfEqualClassificationScores = false;129 130 while (actualThreshold < maxEstimatedValue) {131 double classificationScore = 0.0;132 133 foreach (var pair in estimatedAndTargetValuePairs) {134 //all positives135 if (pair.TargetClassValue.IsAlmost(classValues[i - 1])) {136 if (pair.EstimatedValue > lowerThreshold && pair.EstimatedValue < actualThreshold)137 //true positive138 classificationScore += problemData.GetClassificationPenalty(classValues[i - 1], classValues[i - 1]);139 else140 //false negative141 classificationScore += problemData.GetClassificationPenalty(classValues[i], classValues[i - 1]);142 }143 //all negatives144 else {145 if (pair.EstimatedValue > lowerThreshold && pair.EstimatedValue < actualThreshold)146 //false positive147 classificationScore += problemData.GetClassificationPenalty(classValues[i - 1], classValues[i]);148 else149 //true negative, consider only upper class150 classificationScore += problemData.GetClassificationPenalty(classValues[i], classValues[i]);151 }152 }153 154 //new best classification score found155 if (classificationScore < bestClassificationScore) {156 bestClassificationScore = classificationScore;157 lowestBestThreshold = actualThreshold;158 highestBestThreshold = actualThreshold;159 seriesOfEqualClassificationScores = true;160 }161 //equal classification scores => if seriesOfEqualClassifcationScores == true update highest threshold162 else if (Math.Abs(classificationScore - bestClassificationScore) < double.Epsilon && seriesOfEqualClassificationScores)163 highestBestThreshold = actualThreshold;164 //worse classificatoin score found reset seriesOfEqualClassifcationScores165 else seriesOfEqualClassificationScores = false;166 167 actualThreshold += thresholdIncrement;168 }169 //scale lowest thresholds and highest found optimal threshold according to the misclassification matrix170 double falseNegativePenalty = problemData.GetClassificationPenalty(classValues[i], classValues[i - 1]);171 double falsePositivePenalty = problemData.GetClassificationPenalty(classValues[i - 1], classValues[i]);172 thresholds[i] = (lowestBestThreshold * falsePositivePenalty + highestBestThreshold * falseNegativePenalty) / (falseNegativePenalty + falsePositivePenalty);173 }174 }175 93 } 176 94 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r5662 r5681 115 115 <Compile Include="ClusteringSolution.cs" /> 116 116 <Compile Include="ClassificationEnsembleModel.cs" /> 117 <Compile Include="Interfaces\Classification\IDiscriminantFunctionThresholdCalculator.cs" /> 117 118 <Compile Include="Interfaces\Classification\IClassificationEnsembleModel.cs" /> 118 119 <Compile Include="Interfaces\Regression\IRegressionEnsembleModel.cs" /> … … 152 153 <Compile Include="RegressionSolution.cs" /> 153 154 <Compile Include="TableFileParser.cs" /> 155 <Compile Include="ThresholdCalculators\AccuracyMaximizationThresholdCalculator.cs" /> 156 <Compile Include="ThresholdCalculators\NormalDistributionCutPointsThresholdCalculator.cs" /> 157 <Compile Include="ThresholdCalculators\ThresholdCalculator.cs" /> 154 158 <None Include="HeuristicLab.snk" /> 155 159 <None Include="HeuristicLabProblemsDataAnalysisPlugin.cs.frame" /> -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Tests
- Property svn:ignore
-
old new 1 1 bin 2 2 obj 3 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.ExternalEvaluation.GP.Views/3.3
- Property svn:ignore
-
old new 3 3 HeuristicLabProblemsExternalEvaluationGPViewsPlugin.cs 4 4 HeuristicLab.Problems.ExternalEvaluation.GP.Views-3.3.csproj.user 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.ExternalEvaluation.GP.Views/3.4
- Property svn:ignore
-
old new 3 3 HeuristicLabProblemsExternalEvaluationGPViewsPlugin.cs 4 4 HeuristicLab.Problems.ExternalEvaluation.GP.Views-3.3.csproj.user 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.ExternalEvaluation.GP/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabProblemsExternalEvaluationGPPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.ExternalEvaluation.GP/3.4
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabProblemsExternalEvaluationGPPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.ExternalEvaluation.Views/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabProblemsExternalEvaluationViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.ExternalEvaluation/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabProblemsExternalEvaluationPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.Knapsack.Views/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.Knapsack/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.OneMax.Views/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabProblemsOneMaxViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.OneMax/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.TestFunctions.Views/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabProblemsTestFunctionsViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.TestFunctions/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabProblemsTestFunctionsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.TestFunctions/3.3/Tests
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.TravelingSalesman.Views/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabProblemsTravelingSalesmanViewsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.TravelingSalesman/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabProblemsTravelingSalesmanPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.VehicleRouting.Views/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.VehicleRouting/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Random/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Selection/3.3
- Property svn:ignore
-
old new 3 3 bin 4 4 obj 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.SequentialEngine/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabSequentialEnginePlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Tracing/3.3
- Property svn:ignore
-
old new 3 3 *.user 4 4 HeuristicLabTracingPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab.Visualization.ChartControlsExtensions/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabVisualizationChartControlsExtensionsPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab/3.3
- Property svn:ignore
-
old new 3 3 CustomPostBuild.cmd 4 4 *.user 5 *.vs10x
-
- Property svn:ignore
-
branches/DataAnalysis Refactoring/HeuristicLab/3.3/Tests
- Property svn:ignore
-
old new 2 2 bin 3 3 obj 4 *.vs10x
-
- Property svn:ignore
Note: See TracChangeset
for help on using the changeset viewer.