Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/19/10 18:49:17 (14 years ago)
Author:
gkronber
Message:

Removed max. and min. time offset constraints as algorithm parameters and from all engines. The time constraints were added to the relevant terminal symbols (variable & differential) instead. The time offset constraint can be changed by editing the symbols in the function library. #880 (Max and min time offsets for variable symbols are not set correctly by FunctionLibraryInjectors)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs

    r2825 r2843  
    106106    private object locker = new object();
    107107
     108
     109    public double TrainingSetPercentageSize {
     110      get;
     111      set;
     112    }
     113
     114    public int SkippedRowsBeginning {
     115      get;
     116      set;
     117    }
     118
     119    public int SkippedRowsEnd {
     120      get;
     121      set;
     122    }
     123
    108124    public SimpleDispatcher(IModelingDatabase database, Dataset dataset) {
    109125      this.dataset = dataset;
     
    117133      finishedAndDispatchedRuns = new Dictionary<string, List<AlgorithmConfiguration>>();
    118134
    119      
     135
    120136      defaultAlgorithms = ApplicationManager.Manager.GetInstances<HeuristicLab.Modeling.IAlgorithm>().ToArray();
     137
     138      TrainingSetPercentageSize = 0.5;
     139      SkippedRowsBeginning = 2;
    121140
    122141      // PopulateFinishedRuns();
     
    190209
    191210      if (spec.LearningTask == LearningTask.TimeSeries) {
    192         ITimeSeriesAlgorithm timeSeriesAlgo = (ITimeSeriesAlgorithm)algo;
    193         timeSeriesAlgo.MinTimeOffset = spec.MinTimeOffset;
    194         timeSeriesAlgo.MaxTimeOffset = spec.MaxTimeOffset;
    195         timeSeriesAlgo.TrainingSamplesStart = spec.TrainingSamplesStart - spec.MinTimeOffset + 1; // first possible index is 1 because of differential symbol
     211        algo.TrainingSamplesStart = spec.TrainingSamplesStart + 1; // first possible index is 1 because of differential symbol
    196212        if (spec.AutoRegressive) {
    197213          allowedFeatures.Add(spec.TargetVariable);
     
    255271        if (!(double.IsNaN(x) || double.IsInfinity(x))) break;
    256272      }
     273      firstValueIndex += SkippedRowsBeginning;
    257274      // find index of last correct target value
    258275      int lastValueIndex;
     
    261278        if (!(double.IsNaN(x) || double.IsInfinity(x))) break;
    262279      }
     280      lastValueIndex -= SkippedRowsEnd;
    263281
    264282      int validTargetRange = lastValueIndex - firstValueIndex;
    265283      spec.TrainingSamplesStart = firstValueIndex;
    266       spec.TrainingSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * 0.5);
     284      spec.TrainingSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * TrainingSetPercentageSize);
    267285      spec.ValidationSamplesStart = spec.TrainingSamplesEnd;
    268       spec.ValidationSamplesEnd = firstValueIndex + (int)Math.Floor(validTargetRange * 0.75);
     286      spec.ValidationSamplesEnd = spec.TrainingSamplesEnd + (int)Math.Floor(validTargetRange * (1 - TrainingSetPercentageSize) / 2.0);
    269287      spec.TestSamplesStart = spec.ValidationSamplesEnd;
    270288      spec.TestSamplesEnd = lastValueIndex;
Note: See TracChangeset for help on using the changeset viewer.