- Timestamp:
- 01/01/10 19:06:18 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/AveragePercentageChangeEvaluator.cs
r2222 r2577 38 38 } 39 39 40 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end , bool updateTargetValues) {40 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end) { 41 41 bool differential = GetVariableValue<BoolData>("Differential", scope, true).Data; 42 42 DoubleData apc = GetVariableValue<DoubleData>("APC", scope, false, false); … … 55 55 originalPercentageChange = (dataset.GetValue(sample, targetVariable) - prevOriginal) / prevOriginal; 56 56 estimatedPercentageChange = (evaluator.Evaluate(sample) - prevOriginal) / prevOriginal; 57 if (updateTargetValues) { 58 dataset.SetValue(sample, targetVariable, estimatedPercentageChange * prevOriginal + prevOriginal); 59 } 57 60 58 } else { 61 59 originalPercentageChange = dataset.GetValue(sample, targetVariable); 62 60 estimatedPercentageChange = evaluator.Evaluate(sample); 63 if (updateTargetValues) { 64 dataset.SetValue(sample, targetVariable, estimatedPercentageChange); 65 } 61 66 62 } 67 63 if (!double.IsNaN(originalPercentageChange) && !double.IsInfinity(originalPercentageChange)) { -
trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/OffspringSelectionGPTimeSeriesPrognosis.cs
r2566 r2577 45 45 } 46 46 47 public bool UseEstimatedTargetValue {48 get { return GetVariableInjector().GetVariable("UseEstimatedTargetValue").GetValue<BoolData>().Data; }49 set { GetVariableInjector().GetVariable("UseEstimatedTargetValue").GetValue<BoolData>().Data = value; }50 }51 52 47 protected override IOperator CreateProblemInjector() { 53 48 return DefaultTimeSeriesOperators.CreateProblemInjector(); … … 71 66 injector.AddVariable(new HeuristicLab.Core.Variable("MinTimeOffset", new IntData())); 72 67 injector.AddVariable(new HeuristicLab.Core.Variable("MaxTimeOffset", new IntData())); 73 injector.AddVariable(new HeuristicLab.Core.Variable("UseEstimatedTargetValue", new BoolData()));74 68 return injector; 75 69 } -
trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/ProfitEvaluator.cs
r2222 r2577 38 38 } 39 39 40 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end , bool updateTargetValues) {40 public override void Evaluate(IScope scope, ITreeEvaluator evaluator, HeuristicLab.DataAnalysis.Dataset dataset, int targetVariable, int start, int end) { 41 41 int exchangeRateVarIndex = GetVariableValue<IntData>("ExchangeRate", scope, true).Data; 42 42 double transactionCost = GetVariableValue<DoubleData>("TransactionCost", scope, true).Data; … … 54 54 double originalPercentageChange = dataset.GetValue(sample, targetVariable); 55 55 double estimatedPercentageChange = evaluator.Evaluate(sample); 56 if (updateTargetValues) { 57 dataset.SetValue(sample, targetVariable, estimatedPercentageChange); 58 } 56 59 57 if (!double.IsNaN(originalPercentageChange) && !double.IsInfinity(originalPercentageChange)) { 60 58 if (estimatedPercentageChange > 0) { -
trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/StandardGPTimeSeriesPrognosis.cs
r2566 r2577 45 45 } 46 46 47 public bool UseEstimatedTargetValue {48 get { return GetVariableInjector().GetVariable("UseEstimatedTargetValue").GetValue<BoolData>().Data; }49 set { GetVariableInjector().GetVariable("UseEstimatedTargetValue").GetValue<BoolData>().Data = value; }50 }51 52 47 protected override IOperator CreateProblemInjector() { 53 48 return DefaultTimeSeriesOperators.CreateProblemInjector(); … … 75 70 injector.AddVariable(new HeuristicLab.Core.Variable("MinTimeOffset", new IntData())); 76 71 injector.AddVariable(new HeuristicLab.Core.Variable("MaxTimeOffset", new IntData())); 77 injector.AddVariable(new HeuristicLab.Core.Variable("UseEstimatedTargetValue", new BoolData()));78 72 return injector; 79 73 }
Note: See TracChangeset
for help on using the changeset viewer.