Changeset 6666 for trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleProblemData.cs
- Timestamp:
- 08/17/11 14:37:34 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleProblemData.cs
r6520 r6666 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 using System.IO;25 23 using System.Linq; 26 24 using HeuristicLab.Common; … … 36 34 37 35 public override IEnumerable<int> TrainingIndizes { 38 get { 39 return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start); 40 } 36 get { return Enumerable.Range(TrainingPartition.Start, TrainingPartition.End - TrainingPartition.Start); } 41 37 } 42 38 public override IEnumerable<int> TestIndizes { 43 get { 44 return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start); 45 } 39 get { return Enumerable.Range(TestPartition.Start, TestPartition.End - TestPartition.Start); } 40 } 41 42 private static ClassificationEnsembleProblemData emptyProblemData; 43 public static ClassificationEnsembleProblemData EmptyProblemData { 44 get { return emptyProblemData; } 45 } 46 47 static ClassificationEnsembleProblemData() { 48 var problemData = new ClassificationEnsembleProblemData(); 49 problemData.Parameters.Clear(); 50 problemData.Name = "Empty Classification ProblemData"; 51 problemData.Description = "This ProblemData acts as place holder before the correct problem data is loaded."; 52 problemData.isEmpty = true; 53 54 problemData.Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", new Dataset())); 55 problemData.Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, "")); 56 problemData.Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly())); 57 problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly())); 58 problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>())); 59 problemData.Parameters.Add(new FixedValueParameter<StringMatrix>(ClassNamesParameterName, "", new StringMatrix(0, 0).AsReadOnly())); 60 problemData.Parameters.Add(new FixedValueParameter<DoubleMatrix>(ClassificationPenaltiesParameterName, "", (DoubleMatrix)new DoubleMatrix(0, 0).AsReadOnly())); 61 emptyProblemData = problemData; 46 62 } 47 63 48 64 [StorableConstructor] 49 65 protected ClassificationEnsembleProblemData(bool deserializing) : base(deserializing) { } 66 protected ClassificationEnsembleProblemData(ClassificationEnsembleProblemData original, Cloner cloner) : base(original, cloner) { } 67 public override IDeepCloneable Clone(Cloner cloner) { 68 if (this == emptyProblemData) return emptyProblemData; 69 return new ClassificationEnsembleProblemData(this, cloner); 70 } 50 71 51 protected ClassificationEnsembleProblemData(ClassificationEnsembleProblemData original, Cloner cloner) 52 : base(original, cloner) { 53 } 54 public override IDeepCloneable Clone(Cloner cloner) { return new ClassificationEnsembleProblemData(this, cloner); } 55 72 public ClassificationEnsembleProblemData() : base() { } 56 73 public ClassificationEnsembleProblemData(IClassificationProblemData classificationProblemData) 57 74 : base(classificationProblemData.Dataset, classificationProblemData.AllowedInputVariables, classificationProblemData.TargetVariable) { … … 61 78 this.TestPartition.End = classificationProblemData.TestPartition.End; 62 79 } 80 81 public ClassificationEnsembleProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable) 82 : base(dataset, allowedInputVariables, targetVariable) { 83 } 63 84 } 64 85 }
Note: See TracChangeset
for help on using the changeset viewer.