Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/21/19 09:57:53 (5 years ago)
Author:
gkronber
Message:

#2925: Fixes in problem instances and calculation of numerical differences in Analyze()

Location:
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DynamicalSystemsModelling/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DynamicalSystemsModelling/3.3/Problem.cs

    r16954 r16972  
    862862          var absValues = solutionDataset.GetDoubleValues(name).ToArray();
    863863
    864           solutionDataset.AddVariable(name + "_diff", CalculateDifferences(absValues, NumericDifferencesSmoothing).ToList());
     864          var diffValues = new double[absValues.Length];
     865          foreach(var ep in TrainingEpisodes) {
     866            var y = solutionDataset.GetDoubleValues(name, Enumerable.Range(ep.Start, ep.End - ep.Start)).ToArray();
     867            var yd = CalculateDifferences(y, NumericDifferencesSmoothing).ToArray();
     868            for(int r = ep.Start;  r < ep.End;r++) {
     869              diffValues[r] = yd[r - ep.Start];
     870            }
     871          }
     872
     873          solutionDataset.AddVariable(name + "_diff", diffValues);
    865874          var solutionProblemData = new RegressionProblemData(solutionDataset, problemData.AllowedInputVariables, name + "_diff");
    866           solutionProblemData.TrainingPartition.Start = problemData.TrainingPartition.Start;
    867           solutionProblemData.TrainingPartition.End = problemData.TrainingPartition.End;
     875          solutionProblemData.TrainingPartition.Start = TrainingEpisodes.Select(ep => ep.Start).Min();
     876          solutionProblemData.TrainingPartition.End = TrainingEpisodes.Select(ep => ep.End).Max(); // assumes training episodes are sequential without gaps
    868877          solutionProblemData.TestPartition.Start = problemData.TestPartition.Start;
    869878          solutionProblemData.TestPartition.End = problemData.TestPartition.End;
  • branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DynamicalSystemsModelling/3.3/ProblemInstanceProvider.cs

    r16954 r16972  
    117117    private DataDescriptor Glider() {
    118118      return new DataDescriptor {
    119         Name = "Bar Magnets",
     119        Name = "Glider",
    120120        Description = "Publication: M. Schmidt, H. Lipson; Data-Mining Dynamical Systems: Automated Symbolic System Identification for Exploratory Analysis, ESDA 2008.",
    121121        TargetVariables = new[] { "y1", "y2" },
     
    169169        TargetVariables = new[] { "y1", "y2", "y3", "y4", "y5" },
    170170        InputVariables = new string[] { },
    171         TrainingEpisodes = new IntRange[] { new IntRange(0, 30), new IntRange(31, 61), new IntRange(62, 92) },
     171        TrainingEpisodes = new IntRange[] { new IntRange(0, 31), new IntRange(31, 62), new IntRange(62, 93) },
    172172        TestEpisodes = new IntRange[] { },
    173173        FileName = "S-System.csv"
Note: See TracChangeset for help on using the changeset viewer.