Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/20/14 17:08:41 (10 years ago)
Author:
gkronber
Message:

#1758 made appropriate changes to the problem data classes for trading and time series prognosis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisProblemData.cs

    r10540 r11031  
    16211621    }
    16221622
     1623    protected override bool IsProblemDataCompatible(IDataAnalysisProblemData problemData, out string errorMessage) {
     1624      if (problemData == null) throw new ArgumentNullException("problemData", "The provided problemData is null.");
     1625      ITimeSeriesPrognosisProblemData timeseriesProblemData = problemData as ITimeSeriesPrognosisProblemData;
     1626      if (timeseriesProblemData == null)
     1627        throw new ArgumentException("The problem data is not a time-series problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
     1628
     1629      var returnValue = base.IsProblemDataCompatible(problemData, out errorMessage);
     1630      //check targetVariable
     1631      if (problemData.InputVariables.All(var => var.Value != TargetVariable)) {
     1632        errorMessage = string.Format("The target variable {0} is not present in the new problem data.", TargetVariable)
     1633                       + Environment.NewLine + errorMessage;
     1634        return false;
     1635      }
     1636      return returnValue;
     1637    }
     1638
    16231639    public override void AdjustProblemDataProperties(IDataAnalysisProblemData problemData) {
    16241640      TimeSeriesPrognosisProblemData timeSeriesProblemData = problemData as TimeSeriesPrognosisProblemData;
     
    16261642        throw new ArgumentException("The problem data is not a timeseries problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");
    16271643
     1644      var trainingDataStart = TrainingIndices.First();
     1645     
    16281646      base.AdjustProblemDataProperties(problemData);
     1647     
     1648      TestPartition.Start = trainingDataStart;
    16291649
    16301650      TrainingHorizon = timeSeriesProblemData.TrainingHorizon;
Note: See TracChangeset for help on using the changeset viewer.