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.Regression/3.4
Files:
2 edited

Legend:

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

    r7758 r7759  
    191191      <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
    192192      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
     193      <Private>False</Private>
    193194    </ProjectReference>
    194195    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs

    r7758 r7759  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    2422using System.Linq;
    2523using HeuristicLab.Common;
     
    3432  [Creatable("Problems")]
    3533  public class SymbolicRegressionSingleObjectiveProblem : SymbolicDataAnalysisSingleObjectiveProblem<IRegressionProblemData, ISymbolicRegressionSingleObjectiveEvaluator, ISymbolicDataAnalysisSolutionCreator>, IRegressionProblem,
    36     IProblemInstanceConsumer<RegressionData>, IProblemInstanceExporter<RegressionData> {
     34    IProblemInstanceConsumer<RegressionProblemData>, IProblemInstanceExporter<RegressionProblemData> {
    3735    private const double PunishmentFactor = 10;
    3836    private const int InitialMaximumTreeDepth = 8;
     
    116114    }
    117115
    118     public void Load(RegressionData data) {
     116    public void Load(RegressionProblemData data) {
    119117      Name = data.Name;
    120118      Description = data.Description;
    121       Dataset dataset = new Dataset(data.InputVariables, data.Values);
    122       ProblemData = new RegressionProblemData(dataset, data.AllowedInputVariables, data.TargetVariable);
    123       ProblemData.TrainingPartition.Start = data.TrainingPartitionStart;
    124       ProblemData.TrainingPartition.End = data.TrainingPartitionEnd;
    125       ProblemData.TestPartition.Start = data.TestPartitionStart;
    126       ProblemData.TestPartition.End = data.TestPartitionEnd;
     119      ProblemData = new RegressionProblemData(data.Dataset, data.AllowedInputVariables, data.TargetVariable);
     120      ProblemData.TrainingPartition.Start = data.TrainingPartition.Start;
     121      ProblemData.TrainingPartition.End = data.TrainingPartition.End;
     122      ProblemData.TestPartition.Start = data.TestPartition.Start;
     123      ProblemData.TestPartition.End = data.TestPartition.End;
    127124      OnReset();
    128125    }
    129126
    130     public RegressionData Export() {
    131       if (!ProblemData.InputVariables.Count.Equals(ProblemData.Dataset.DoubleVariables.Count()))
    132         throw new ArgumentException("Not all input variables are double variables! (Export only works with double variables)");
    133 
    134       RegressionData regData = new RegressionData();
     127    public RegressionProblemData Export() {
     128      RegressionProblemData regData = new RegressionProblemData(ProblemData.Dataset, ProblemData.AllowedInputVariables, ProblemData.TargetVariable);
    135129      regData.Name = Name;
    136130      regData.Description = Description;
    137       regData.TargetVariable = ProblemData.TargetVariable;
    138       regData.InputVariables = ProblemData.InputVariables.Select(x => x.Value).ToArray();
    139       regData.AllowedInputVariables = ProblemData.AllowedInputVariables.ToArray();
    140       regData.TrainingPartitionStart = ProblemData.TrainingPartition.Start;
    141       regData.TrainingPartitionEnd = ProblemData.TrainingPartition.End;
    142       regData.TestPartitionStart = ProblemData.TestPartition.Start;
    143       regData.TestPartitionEnd = ProblemData.TestPartition.End;
    144 
    145       List<List<double>> data = new List<List<double>>();
    146       foreach (var variable in ProblemData.Dataset.DoubleVariables) {
    147         data.Add(ProblemData.Dataset.GetDoubleValues(variable).ToList());
    148       }
    149       regData.Values = Transformer.Transformation(data);
    150 
     131      regData.TrainingPartition.Start = ProblemData.TrainingPartition.Start;
     132      regData.TrainingPartition.End = ProblemData.TrainingPartition.End;
     133      regData.TestPartition.Start = ProblemData.TestPartition.Start;
     134      regData.TestPartition.End = ProblemData.TestPartition.End;
    151135      return regData;
    152136    }
Note: See TracChangeset for help on using the changeset viewer.