Changeset 6672 for trunk/sources/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 08/19/11 11:12:25 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleProblemData.cs
r6666 r6672 21 21 22 22 using System.Collections.Generic; 23 using System.Linq;24 23 using HeuristicLab.Common; 25 24 using HeuristicLab.Core; … … 33 32 public class ClassificationEnsembleProblemData : ClassificationProblemData { 34 33 35 public override IEnumerable<int> TrainingIndizes { 36 get { return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start); } 37 } 38 public override IEnumerable<int> TestIndizes { 39 get { return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start); } 34 public override bool IsTrainingSample(int index) { 35 return index >= 0 && index < Dataset.Rows && 36 TrainingPartition.Start <= index && index < TrainingPartition.End; 40 37 } 41 38 42 private static ClassificationEnsembleProblemData emptyProblemData; 39 public override bool IsTestSample(int index) { 40 return index >= 0 && index < Dataset.Rows && 41 TestPartition.Start <= index && index < TestPartition.End; 42 } 43 44 private static readonly ClassificationEnsembleProblemData emptyProblemData; 43 45 public static ClassificationEnsembleProblemData EmptyProblemData { 44 46 get { return emptyProblemData; } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
r6666 r6672 171 171 {1176881,7,5,3,7,4,10,7,5,5,4 } 172 172 }; 173 private static Dataset defaultDataset;174 private static IEnumerable<string> defaultAllowedInputVariables;175 private static string defaultTargetVariable;176 177 private static ClassificationProblemData emptyProblemData;173 private static readonly Dataset defaultDataset; 174 private static readonly IEnumerable<string> defaultAllowedInputVariables; 175 private static readonly string defaultTargetVariable; 176 177 private static readonly ClassificationProblemData emptyProblemData; 178 178 public static ClassificationProblemData EmptyProblemData { 179 179 get { return EmptyProblemData; } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs
r6666 r6672 78 78 get { 79 79 return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start) 80 .Where( i => i >= 0 && i < Dataset.Rows && (i < TestPartition.Start || TestPartition.End <= i));80 .Where(IsTrainingSample); 81 81 } 82 82 } … … 84 84 get { 85 85 return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start) 86 .Where( i => i >= 0 && i < Dataset.Rows);86 .Where(IsTestSample); 87 87 } 88 } 89 90 public virtual bool IsTrainingSample(int index) { 91 return index >= 0 && index < Dataset.Rows && 92 TrainingPartition.Start <= index && index < TrainingPartition.End && 93 (index < TestPartition.Start || TestPartition.End <= index); 94 } 95 96 public virtual bool IsTestSample(int index) { 97 return index >= 0 && index < Dataset.Rows && 98 TestPartition.Start <= index && index < TestPartition.End; 88 99 } 89 100 #endregion -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleProblemData.cs
r6666 r6672 21 21 22 22 using System.Collections.Generic; 23 using System.Linq;24 23 using HeuristicLab.Common; 25 24 using HeuristicLab.Core; … … 33 32 public sealed class RegressionEnsembleProblemData : RegressionProblemData { 34 33 35 public override IEnumerable<int> TrainingIndizes { 36 get { 37 return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start); 38 } 34 public override bool IsTrainingSample(int index) { 35 return index >= 0 && index < Dataset.Rows && 36 TrainingPartition.Start <= index && index < TrainingPartition.End; 39 37 } 40 38 41 public override IEnumerable<int> TestIndizes { 42 get { 43 return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start); 44 } 39 public override bool IsTestSample(int index) { 40 return index >= 0 && index < Dataset.Rows && 41 TestPartition.Start <= index && index < TestPartition.End; 45 42 } 46 43 47 private static RegressionEnsembleProblemData emptyProblemData;44 private static readonly RegressionEnsembleProblemData emptyProblemData; 48 45 public new static RegressionEnsembleProblemData EmptyProblemData { 49 46 get { return emptyProblemData; } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r6666 r6672 64 64 {0.83763905, 0.468046718} 65 65 }; 66 private static Dataset defaultDataset;67 private static IEnumerable<string> defaultAllowedInputVariables;68 private static string defaultTargetVariable;66 private static readonly Dataset defaultDataset; 67 private static readonly IEnumerable<string> defaultAllowedInputVariables; 68 private static readonly string defaultTargetVariable; 69 69 70 private static RegressionProblemData emptyProblemData;70 private static readonly RegressionProblemData emptyProblemData; 71 71 public static RegressionProblemData EmptyProblemData { 72 72 get { return emptyProblemData; } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs
r6666 r6672 39 39 IEnumerable<int> TestIndizes { get; } 40 40 41 bool IsTrainingSample(int index); 42 bool IsTestSample(int index); 43 41 44 event EventHandler Changed; 42 45 }
Note: See TracChangeset
for help on using the changeset viewer.