Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/15/09 16:23:29 (15 years ago)
Author:
gkronber
Message:

Implemented #704 (Shuffling of training data (only) in (non-timeseries) modeling algorithms)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs

    r2127 r2161  
    142142      seq.Name = "Initialization";
    143143      seq.AddSubOperator(CreateGlobalInjector());
    144       seq.AddSubOperator(new ProblemInjector());
     144      ProblemInjector probInjector = new ProblemInjector();
     145      probInjector.GetVariableInfo("MaxNumberOfTrainingSamples").Local = true;
     146      probInjector.AddVariable(new Variable("MaxNumberOfTrainingSamples", new IntData(5000)));
     147      seq.AddSubOperator(probInjector);
    145148      seq.AddSubOperator(new RandomInjector());
     149
     150      DatasetShuffler shuffler = new DatasetShuffler();
     151      shuffler.GetVariableInfo("ShuffleStart").ActualName = "TrainingSamplesStart";
     152      shuffler.GetVariableInfo("ShuffleEnd").ActualName = "TrainingSamplesEnd";
     153      seq.AddSubOperator(shuffler);
    146154      return seq;
    147155    }
     
    246254
    247255      SupportVectorCreator modelCreator = new SupportVectorCreator();
    248       modelCreator.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
    249       modelCreator.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
     256      modelCreator.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
     257      modelCreator.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
    250258      modelCreator.GetVariableInfo("SVMCost").ActualName = "Cost";
    251259      modelCreator.GetVariableInfo("SVMGamma").ActualName = "Gamma";
     
    256264
    257265      modelProcessor.AddSubOperator(modelCreator);
    258       CombinedOperator trainingEvaluator = (CombinedOperator)CreateEvaluator("Training");
     266      CombinedOperator trainingEvaluator = (CombinedOperator)CreateEvaluator("ActualTraining");
    259267      trainingEvaluator.OperatorGraph.InitialOperator.SubOperators[1].GetVariableInfo("MSE").ActualName = "Quality";
    260268      modelProcessor.AddSubOperator(trainingEvaluator);
     
    415423      model.ValidationMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("ValidationQuality", false).Data;
    416424      model.TestMeanSquaredError = bestModelScope.GetVariableValue<DoubleData>("TestQuality", false).Data;
    417       model.TrainingCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TrainingR2", false).Data;
     425      model.TrainingCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("ActualTrainingR2", false).Data;
    418426      model.ValidationCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("ValidationR2", false).Data;
    419427      model.TestCoefficientOfDetermination = bestModelScope.GetVariableValue<DoubleData>("TestR2", false).Data;
    420       model.TrainingMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TrainingMAPE", false).Data;
     428      model.TrainingMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("ActualTrainingMAPE", false).Data;
    421429      model.ValidationMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPE", false).Data;
    422430      model.TestMeanAbsolutePercentageError = bestModelScope.GetVariableValue<DoubleData>("TestMAPE", false).Data;
    423       model.TrainingMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TrainingMAPRE", false).Data;
     431      model.TrainingMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("ActualTrainingMAPRE", false).Data;
    424432      model.ValidationMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("ValidationMAPRE", false).Data;
    425433      model.TestMeanAbsolutePercentageOfRangeError = bestModelScope.GetVariableValue<DoubleData>("TestMAPRE", false).Data;
    426       model.TrainingVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TrainingVAF", false).Data;
     434      model.TrainingVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("ActualTrainingVAF", false).Data;
    427435      model.ValidationVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("ValidationVAF", false).Data;
    428436      model.TestVarianceAccountedFor = bestModelScope.GetVariableValue<DoubleData>("TestVAF", false).Data;
Note: See TracChangeset for help on using the changeset viewer.