Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4457


Ignore:
Timestamp:
09/21/10 10:16:49 (14 years ago)
Author:
gkronber
Message:

made DataAnalysisProblem and DataAnalysisProblemData and SymbolicTimeSeriesPrognosisSolution savable and added field for conditional evaluation to Symbolic/SymbolicTimeSeriesPrognosisSolution. #1142

Location:
branches/DataAnalysis
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis.Views/3.3/ResultsView.cs

    r4401 r4457  
    145145
    146146      for (int row = start; row < end; row++) {
    147         // prepare evaluators for each target variable for a new prediction window
    148         foreach (var entry in evaluators) {
    149           double referenceOriginalValue = Content.ProblemData.Dataset[entry.Key, row - 1];
    150           foreach (IOnlineTimeSeriesPrognosisEvaluator evaluator in entry.Value.OfType<IOnlineTimeSeriesPrognosisEvaluator>()) {
    151             evaluator.StartNewPredictionWindow(referenceOriginalValue);
     147        if (string.IsNullOrEmpty(Content.ConditionalEvaluationVariable) || Content.ProblemData.Dataset[Content.ConditionalEvaluationVariable, row] != 0) {
     148          // prepare evaluators for each target variable for a new prediction window
     149          foreach (var entry in evaluators) {
     150            double referenceOriginalValue = Content.ProblemData.Dataset[entry.Key, row - 1];
     151            foreach (IOnlineTimeSeriesPrognosisEvaluator evaluator in entry.Value.OfType<IOnlineTimeSeriesPrognosisEvaluator>()) {
     152              evaluator.StartNewPredictionWindow(referenceOriginalValue);
     153            }
    152154          }
    153         }
    154         List<string> targetVariables = Content.ProblemData.TargetVariables.CheckedItems.Select(x => x.Value.Value).ToList();
     155          List<string> targetVariables = Content.ProblemData.TargetVariables.CheckedItems.Select(x => x.Value.Value).ToList();
    155156
    156         int timestep = 0;
    157         foreach (double[] x in Content.GetPrognosis(row)) {
    158           int targetIndex = 0;
    159           foreach (var targetVariable in targetVariables) {
    160             double originalValue = Content.ProblemData.Dataset[targetVariable, row + timestep];
    161             double estimatedValue = x[targetIndex];
    162             if (IsValidValue(originalValue) && IsValidValue(estimatedValue)) {
    163               foreach (IOnlineEvaluator evaluator in evaluators[targetVariable]) {
    164                 evaluator.Add(originalValue, estimatedValue);
     157          int timestep = 0;
     158          foreach (double[] x in Content.GetPrognosis(row)) {
     159            int targetIndex = 0;
     160            foreach (var targetVariable in targetVariables) {
     161              double originalValue = Content.ProblemData.Dataset[targetVariable, row + timestep];
     162              double estimatedValue = x[targetIndex];
     163              if (IsValidValue(originalValue) && IsValidValue(estimatedValue)) {
     164                foreach (IOnlineEvaluator evaluator in evaluators[targetVariable]) {
     165                  evaluator.Add(originalValue, estimatedValue);
     166                }
    165167              }
     168              targetIndex++;
    166169            }
    167             targetIndex++;
     170            timestep++;
    168171          }
    169           timestep++;
    170172        }
    171173      }
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis/3.3/Symbolic/Analyzer/ValidationBestScaledSymbolicTimeSeriesPrognosisSolutionAnalyzer.cs

    r4401 r4457  
    295295        model.Description = "Best solution on validation partition found over the whole run.";
    296296
    297         var solution = new SymbolicTimeSeriesPrognosisSolution(ProblemData, model, PredictionHorizon.Value);
     297        var solution = new SymbolicTimeSeriesPrognosisSolution(ProblemData, model, PredictionHorizon.Value, conditionalVariableName);
    298298        solution.Name = BestSolutionParameterName;
    299299        solution.Description = "Best solution on validation partition found over the whole run.";
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis/3.3/Symbolic/SymbolicTimeSeriesPrognosisSolution.cs

    r4401 r4457  
    3535  [StorableClass]
    3636  [Item("SymbolicTimeSeriesPrognosisSolution", "Represents a solution for time series prognosis.")]
    37   public class SymbolicTimeSeriesPrognosisSolution : NamedItem, IMultiVariateDataAnalysisSolution {
     37  public class SymbolicTimeSeriesPrognosisSolution : NamedItem, IMultiVariateDataAnalysisSolution, IStorableContent {
    3838    [Storable]
    3939    private MultiVariateDataAnalysisProblemData problemData;
     
    4242    [Storable]
    4343    private int horizon;
     44    [Storable]
     45    private string conditionalEvaluationVariable;
     46
     47    public string FileName { get; set; }
    4448
    4549    [StorableConstructor]
     
    5054    }
    5155
    52     public SymbolicTimeSeriesPrognosisSolution(MultiVariateDataAnalysisProblemData problemData, SymbolicTimeSeriesPrognosisModel model, int horizon)
     56    public SymbolicTimeSeriesPrognosisSolution(MultiVariateDataAnalysisProblemData problemData, SymbolicTimeSeriesPrognosisModel model, int horizon, string conditionalEvaluationVariable)
    5357      : this() {
    5458      this.problemData = problemData;
    5559      this.model = model;
    5660      this.horizon = horizon;
     61      this.conditionalEvaluationVariable = conditionalEvaluationVariable;
    5762    }
    5863
     
    8287          model = value;
    8388          RaiseModelChanged();
     89        }
     90      }
     91    }
     92
     93    public string ConditionalEvaluationVariable {
     94      get { return conditionalEvaluationVariable; }
     95      set {
     96        if (conditionalEvaluationVariable != value) {
     97          conditionalEvaluationVariable = value;
     98          RaiseEstimatedValuesChanged();
    8499        }
    85100      }
     
    182197      clone.model = (SymbolicTimeSeriesPrognosisModel)cloner.Clone(model);
    183198      clone.horizon = horizon;
     199      clone.conditionalEvaluationVariable = conditionalEvaluationVariable;
    184200      return clone;
    185201    }
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/MultiVariateDataAnalysisProblem.cs

    r4112 r4457  
    3333  [Creatable("Problems")]
    3434  [StorableClass]
    35   public class MultiVariateDataAnalysisProblem : ParameterizedNamedItem, IMultiVariateDataAnalysisProblem {
     35  public class MultiVariateDataAnalysisProblem : ParameterizedNamedItem, IMultiVariateDataAnalysisProblem, IStorableContent {
    3636    private const string MultiVariateDataAnalysisProblemDataParameterName = "MultiVariateDataAnalysisProblem";
    3737    public override Image ItemImage {
    3838      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; }
    3939    }
     40
     41    public string FileName { get; set; }
    4042
    4143    #region Parameter Properties
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate/3.3/MultiVariateDataAnalysisProblemData.cs

    r4068 r4457  
    3232  [Item("MultiVariateDataAnalysisProblemData", "Represents an item containing all data defining a multi-variate data analysis problem.")]
    3333  [StorableClass]
    34   public class MultiVariateDataAnalysisProblemData : ParameterizedNamedItem {
     34  public class MultiVariateDataAnalysisProblemData : ParameterizedNamedItem, IStorableContent {
    3535    private bool suppressEvents = false;
     36    public string FileName { get; set; }
    3637    #region default data
    3738    // y0 = x^4 + x^3 + x^2 + x
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblem.cs

    r4118 r4457  
    3333  [Creatable("Problems")]
    3434  [StorableClass]
    35   public class DataAnalysisProblem : ParameterizedNamedItem, IDataAnalysisProblem {
     35  public class DataAnalysisProblem : ParameterizedNamedItem, IDataAnalysisProblem, IStorableContent {
    3636    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
    3737    public override Image ItemImage {
    3838      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; }
    3939    }
     40
     41    public string FileName { get; set; }
    4042
    4143    #region Parameter Properties
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs

    r4341 r4457  
    3333  [Item("DataAnalysisProblemData", "Represents an item containing all data defining a data analysis problem.")]
    3434  [StorableClass]
    35   public class DataAnalysisProblemData : ParameterizedNamedItem {
     35  public class DataAnalysisProblemData : ParameterizedNamedItem, IStorableContent {
    3636    private bool suppressEvents = false;
     37
     38    #region IStorableContent Members
     39    public string Filename { get; set; }
     40    #endregion
     41
    3742    #region default data
    3843    // y = x^4 + x^3 + x^2 + x
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs

    r4401 r4457  
    3333  [Item("DataAnalysisSolution", "Represents a solution for a data analysis problem which can be visualized in the GUI.")]
    3434  [StorableClass]
    35   public abstract class DataAnalysisSolution : NamedItem {
     35  public abstract class DataAnalysisSolution : NamedItem, IStorableContent {
     36    #region IStorableContent Members
     37    public string Filename { get; set; }
     38    #endregion
     39
     40
    3641    protected DataAnalysisSolution()
    3742      : base() { }
Note: See TracChangeset for help on using the changeset viewer.