Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/30/12 12:52:09 (13 years ago)
Author:
sforsten
Message:

#1784:

  • added some regions for readability
  • added import and export methods in DataAnalysisProblem and SymbolicDataAnalysisProblem to reduce code duplication
  • added a recursive and an iterative approach without many linq expression to generate all combinations of list elements in ValueGenerator
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs

    r7759 r7770  
    111111    }
    112112
     113    #region Import & Export
    113114    public void Load(ClassificationProblemData data) {
    114       Name = data.Name;
    115       Description = data.Description;
    116       ProblemData = new ClassificationProblemData(data.Dataset, data.AllowedInputVariables, data.TargetVariable);
    117       ProblemData.TrainingPartition.Start = data.TrainingPartition.Start;
    118       ProblemData.TrainingPartition.End = data.TrainingPartition.End;
    119       ProblemData.TestPartition.Start = data.TestPartition.Start;
    120       ProblemData.TestPartition.End = data.TestPartition.End;
    121       OnReset();
     115      base.Load(data);
    122116    }
    123117
    124118    public ClassificationProblemData Export() {
    125       ClassificationProblemData claData = new ClassificationProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable);
    126       claData.Name = Name;
    127       claData.Description = Description;
    128       claData.TrainingPartition.Start = ProblemData.TrainingPartition.Start;
    129       claData.TrainingPartition.End = ProblemData.TrainingPartition.End;
    130       claData.TestPartition.Start = ProblemData.TestPartition.Start;
    131       claData.TestPartition.End = ProblemData.TestPartition.End;
    132       return claData;
     119      if (ProblemData is ClassificationProblemData) {
     120        return (ClassificationProblemData)ProblemData;
     121      } else {
     122        ClassificationProblemData claData = new ClassificationProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable);
     123        return (ClassificationProblemData)base.Export(claData);
     124      }
    133125    }
     126    #endregion
    134127  }
    135128}
Note: See TracChangeset for help on using the changeset viewer.