Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/24/12 16:37:40 (13 years ago)
Author:
sforsten
Message:

#1784:

  • deleted ClassificationData and RegressionData. RegressionProblemData and ClassificationProblemData are used instead
  • deleted not needed Transformer
  • ValueGenerator is now a static class and yield return is used return IEnumerable
Location:
branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj

    r7758 r7759  
    196196      <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
    197197      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
     198      <Private>False</Private>
    198199    </ProjectReference>
    199200    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs

    r7758 r7759  
    1919 */
    2020#endregion
    21 using System;
    22 using System.Collections.Generic;
    2321using System.Linq;
    2422using HeuristicLab.Common;
     
    3331  [Creatable("Problems")]
    3432  public class SymbolicClassificationSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IClassificationProblemData, ISymbolicClassificationSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IClassificationProblem,
    35     IProblemInstanceConsumer<ClassificationData>, IProblemInstanceExporter<ClassificationData> {
     33    IProblemInstanceConsumer<ClassificationProblemData>, IProblemInstanceExporter<ClassificationProblemData> {
    3634    private const double PunishmentFactor = 10;
    3735    private const int InitialMaximumTreeDepth = 8;
     
    113111    }
    114112
    115     public void Load(ClassificationData data) {
     113    public void Load(ClassificationProblemData data) {
    116114      Name = data.Name;
    117115      Description = data.Description;
    118       Dataset dataset = new Dataset(data.InputVariables, data.Values);
    119       ProblemData = new ClassificationProblemData(dataset, data.AllowedInputVariables, data.TargetVariable);
    120       ProblemData.TrainingPartition.Start = data.TrainingPartitionStart;
    121       ProblemData.TrainingPartition.End = data.TrainingPartitionEnd;
    122       ProblemData.TestPartition.Start = data.TestPartitionStart;
    123       ProblemData.TestPartition.End = data.TestPartitionEnd;
     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;
    124121      OnReset();
    125122    }
    126123
    127     public ClassificationData Export() {
    128       if (!ProblemData.InputVariables.Count.Equals(ProblemData.Dataset.DoubleVariables.Count()))
    129         throw new ArgumentException("Not all input variables are double variables! (Export only works with double variables)");
    130 
    131       ClassificationData claData = new ClassificationData();
     124    public ClassificationProblemData Export() {
     125      ClassificationProblemData claData = new ClassificationProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable);
    132126      claData.Name = Name;
    133127      claData.Description = Description;
    134       claData.TargetVariable = ProblemData.TargetVariable;
    135       claData.InputVariables = ProblemData.InputVariables.Select(x => x.Value).ToArray();
    136       claData.AllowedInputVariables = ProblemData.AllowedInputVariables.ToArray();
    137       claData.TrainingPartitionStart = ProblemData.TrainingPartition.Start;
    138       claData.TrainingPartitionEnd = ProblemData.TrainingPartition.End;
    139       claData.TestPartitionStart = ProblemData.TestPartition.Start;
    140       claData.TestPartitionEnd = ProblemData.TestPartition.End;
    141 
    142       List<List<double>> data = new List<List<double>>();
    143       foreach (var variable in ProblemData.Dataset.DoubleVariables) {
    144         data.Add(ProblemData.Dataset.GetDoubleValues(variable).ToList());
    145       }
    146       claData.Values = Transformer.Transformation(data);
    147 
     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;
    148132      return claData;
    149133    }
Note: See TracChangeset for help on using the changeset viewer.