Changeset 7866 for branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression
- Timestamp:
- 05/22/12 10:36:20 (12 years ago)
- Location:
- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs
r7259 r7866 97 97 98 98 RegisterRegressionSolutionsEventHandler(); 99 } 100 101 public RegressionEnsembleSolution(IRegressionProblemData problemData) 102 : this(Enumerable.Empty<IRegressionModel>(), problemData) { 99 103 } 100 104 -
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs
r7259 r7866 40 40 ProblemData = new RegressionProblemData(); 41 41 } 42 43 public override void ImportProblemDataFromFile(string fileName) {44 RegressionProblemData problemData = RegressionProblemData.ImportFromFile(fileName);45 ProblemData = problemData;46 }47 42 } 48 43 } -
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r7259 r7866 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.IO;25 24 using System.Linq; 26 25 using HeuristicLab.Common; … … 136 135 OnChanged(); 137 136 } 138 139 #region Import from file140 public static RegressionProblemData ImportFromFile(string fileName) {141 TableFileParser csvFileParser = new TableFileParser();142 csvFileParser.Parse(fileName);143 144 Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);145 dataset.Name = Path.GetFileName(fileName);146 147 RegressionProblemData problemData = new RegressionProblemData(dataset, dataset.DoubleVariables.Skip(1), dataset.DoubleVariables.First());148 problemData.Name = "Data imported from " + Path.GetFileName(fileName);149 return problemData;150 }151 #endregion152 137 } 153 138 } -
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs
r7259 r7866 44 44 protected RegressionSolution(IRegressionModel model, IRegressionProblemData problemData) 45 45 : base(model, problemData) { 46 evaluationCache = new Dictionary<int, double>( );46 evaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows); 47 47 } 48 48 -
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs
r7272 r7866 21 21 22 22 using System.Collections.Generic; 23 using System.Linq;24 23 using HeuristicLab.Common; 25 24 using HeuristicLab.Data; … … 166 165 167 166 protected void CalculateResults() { 168 double[] estimatedTrainingValues = EstimatedTrainingValues.ToArray(); // cache values169 double[] originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToArray();170 double[] estimatedTestValues = EstimatedTestValues.ToArray(); // cache values171 double[] originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes).ToArray();167 IEnumerable<double> estimatedTrainingValues = EstimatedTrainingValues; // cache values 168 IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes); 169 IEnumerable<double> estimatedTestValues = EstimatedTestValues; // cache values 170 IEnumerable<double> originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes); 172 171 173 172 OnlineCalculatorError errorState;
Note: See TracChangeset
for help on using the changeset viewer.