Changeset 7085 for branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/NormalizedGiniCalculator.cs
- Timestamp:
- 11/28/11 13:47:28 (12 years ago)
- Location:
- branches/RegressionBenchmarks
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RegressionBenchmarks
- Property svn:ignore
-
old new 4 4 *.suo 5 5 *.vsp 6 Doxygen 6 7 Google.ProtocolBuffers-0.9.1.dll 7 8 HeuristicLab 3.3.5.1.ReSharper.user 8 9 HeuristicLab 3.3.6.0.ReSharper.user 9 10 HeuristicLab.4.5.resharper.user 11 HeuristicLab.ExtLibs.6.0.ReSharper.user 10 12 HeuristicLab.resharper.user 11 13 ProtoGen.exe … … 16 18 bin 17 19 protoc.exe 18 HeuristicLab.ExtLibs.6.0.ReSharper.user19 Doxygen
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis (added) merged: 6961,6963-6964,6974,6980,6982,7011,7017,7021,7023,7043,7049
- Property svn:mergeinfo changed
-
branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/NormalizedGiniCalculator.cs
r6913 r7085 28 28 public class NormalizedGiniCalculator { 29 29 30 public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated, out OnlineCalculatorError errorState) { 31 if (original.Count() != estimated.Count()) { 32 throw new ArgumentException("Number of elements in first and second enumeration doesn't match."); 30 public static double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) { 31 var originalValuesArr = originalValues.ToArray(); 32 var estimatedValuesArr = estimatedValues.ToArray(); 33 if (originalValuesArr.Count() != estimatedValuesArr.Count()) { 34 throw new ArgumentException("Number of elements in originalValues and estimatedValues enumerations doesn't match."); 33 35 } 34 double oe = Gini(original , estimated, out errorState);36 double oe = Gini(originalValuesArr, estimatedValuesArr, out errorState); 35 37 if (errorState != OnlineCalculatorError.None) return double.NaN; 36 38 37 return oe / (Gini(original , original, out errorState));39 return oe / (Gini(originalValuesArr, originalValuesArr, out errorState)); 38 40 } 39 41
Note: See TracChangeset
for help on using the changeset viewer.