- Timestamp:
- 02/17/11 12:16:46 (14 years ago)
- Location:
- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisSolution.cs
r5490 r5507 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Core; 23 24 … … 26 27 IDataAnalysisModel Model { get; } 27 28 IDataAnalysisProblemData ProblemData { get; } 29 30 EventHandler ModelChanged; 31 EventHandler ProblemDataChanged; 28 32 } 29 33 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs
r5501 r5507 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 namespace HeuristicLab.Problems.DataAnalysis { 23 24 public interface IRegressionnSolution : IDataAnalysisSolution { 24 25 new IRegressionModel Model { get; } 25 26 new IRegressionProblemData ProblemData { get; } 27 28 IEnumerable<double> EstimatedValues { get; } 29 IEnumerable<double> EstimatedTrainingValues { get; } 30 IEnumerable<double> EstimatedTestValues { get; } 31 IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows); 26 32 } 27 33 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineCovarianceEvaluator.cs
r5491 r5507 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 24 25 namespace HeuristicLab.Problems.DataAnalysis { … … 67 68 } 68 69 #endregion 70 71 public static double Calculate(IEnumerable<double> first, IEnumerable<double> second) { 72 IEnumerator<double> firstEnumerator = first.GetEnumerator(); 73 IEnumerator<double> secondEnumerator = second.GetEnumerator(); 74 OnlineCovarianceEvaluator covarianceEvaluator = new OnlineCovarianceEvaluator(); 75 76 while (firstEnumerator.MoveNext() & secondEnumerator.MoveNext()) { 77 double estimated = secondEnumerator.Current; 78 double original = firstEnumerator.Current; 79 covarianceEvaluator.Add(original, estimated); 80 } 81 82 if (secondEnumerator.MoveNext() || firstEnumerator.MoveNext()) { 83 throw new ArgumentException("Number of elements in first and second enumeration doesn't match."); 84 } else { 85 return covarianceEvaluator.Covariance; 86 } 87 } 69 88 } 70 89 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs
r5491 r5507 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using HeuristicLab.Common; 24 25 … … 63 64 64 65 #endregion 66 67 public static double Calculate(IEnumerable<double> first, IEnumerable<double> second) { 68 IEnumerator<double> firstEnumerator = first.GetEnumerator(); 69 IEnumerator<double> secondEnumerator = second.GetEnumerator(); 70 OnlineMeanAbsolutePercentageErrorEvaluator evaluator = new OnlineMeanAbsolutePercentageErrorEvaluator(); 71 72 while (firstEnumerator.MoveNext() & secondEnumerator.MoveNext()) { 73 double estimated = secondEnumerator.Current; 74 double original = firstEnumerator.Current; 75 evaluator.Add(original, estimated); 76 } 77 78 if (secondEnumerator.MoveNext() || firstEnumerator.MoveNext()) { 79 throw new ArgumentException("Number of elements in first and second enumeration doesn't match."); 80 } else { 81 return evaluator.MeanAbsolutePercentageError; 82 } 83 } 65 84 } 66 85 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineNormalizedMeanSquaredErrorEvaluator.cs
r5491 r5507 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 24 25 namespace HeuristicLab.Problems.DataAnalysis { … … 60 61 } 61 62 #endregion 63 64 public static double Calculate(IEnumerable<double> first, IEnumerable<double> second) { 65 IEnumerator<double> firstEnumerator = first.GetEnumerator(); 66 IEnumerator<double> secondEnumerator = second.GetEnumerator(); 67 OnlineNormalizedMeanSquaredErrorEvaluator normalizedMSEEvaluator = new OnlineNormalizedMeanSquaredErrorEvaluator(); 68 69 while (firstEnumerator.MoveNext() & secondEnumerator.MoveNext()) { 70 double estimated = secondEnumerator.Current; 71 double original = firstEnumerator.Current; 72 normalizedMSEEvaluator.Add(original, estimated); 73 } 74 75 if (secondEnumerator.MoveNext() || firstEnumerator.MoveNext()) { 76 throw new ArgumentException("Number of elements in first and second enumeration doesn't match."); 77 } else { 78 return normalizedMSEEvaluator.NormalizedMeanSquaredError; 79 } 80 } 62 81 } 63 82 }
Note: See TracChangeset
for help on using the changeset viewer.