Changeset 7998 for branches/HeuristicLab.TimeSeries
- Timestamp:
- 06/13/12 15:35:22 (13 years ago)
- Location:
- branches/HeuristicLab.TimeSeries
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveMeanSquaredErrorEvaluator.cs
r7989 r7998 62 62 63 63 public static double Calculate(ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, ITimeSeriesPrognosisProblemData problemData, IEnumerable<int> rows, int horizon, bool applyLinearScaling) { 64 IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows.SelectMany(r => Enumerable.Range(r, horizon))); 65 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows, horizon).SelectMany(x => x); 64 int horizion2 = problemData.TrainingPartition.End - problemData.TrainingPartition.Start; 65 IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows.Take(1).Select(r => Enumerable.Range(r, horizion2)).First()); 66 IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows.Take(1), horizion2).SelectMany(x => x); 66 67 IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit); 67 68 OnlineCalculatorError errorState; -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SymbolicTimeSeriesPrognosisExpressionTreeInterpreter.cs
r7991 r7998 86 86 int row = rowsEnumerator.Current; 87 87 int horizon = horizonsEnumerator.Current; 88 double[] vProgs = new double[horizon]; 88 89 89 double[] vProgs = new double[horizon];90 90 for (int i = 0; i < horizon; i++) { 91 91 int localRow = i + row; // create a local variable for the ref parameter … … 95 95 state.Reset(); 96 96 } 97 98 97 yield return vProgs; 99 98 … … 121 120 instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName); 122 121 } else if (instr.opCode == OpCodes.LagVariable) { 123 var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode; 124 instr.iArg0 = dataset.GetReadOnlyDoubleValues(laggedVariableTreeNode.VariableName); 122 var variableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode; 123 if (variableTreeNode.VariableName == TargetVariable) 124 instr.iArg0 = targetVariableCache; 125 else 126 instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName); 125 127 } else if (instr.opCode == OpCodes.VariableCondition) { 126 var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode; 127 instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableConditionTreeNode.VariableName); 128 var variableTreeNode = (VariableConditionTreeNode)instr.dynamicNode; 129 if (variableTreeNode.VariableName == TargetVariable) 130 instr.iArg0 = targetVariableCache; 131 else 132 instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName); 128 133 } else if (instr.opCode == OpCodes.Call) { 129 134 necessaryArgStackSize += instr.nArguments + 1; -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionLineChartView.cs
r7989 r7998 214 214 } 215 215 } else if (Content != null) { 216 string targetVariable = Content.ProblemData.TargetVariable;217 218 216 IEnumerable<int> indizes = null; 219 217 IEnumerable<double> predictedValues = null; -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionPrognosedValuesView.cs
r7989 r7998 124 124 matrix.ColumnNames = columnNames.ToArray(); 125 125 matrix.SortableView = true; 126 matrixView.Content = matrix; 126 127 } 127 128 #endregion -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TimeSeries/TimeSeriesPrognosisInstanceProvider.cs
r7989 r7998 21 21 22 22 using System; 23 using System.Collections;24 23 using System.Collections.Generic; 25 24 using System.IO; … … 37 36 Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values); 38 37 string targetVar = csvFileParser.VariableNames.Last(); 39 40 IEnumerable<string> allowedInputVars = csvFileParser.VariableNames.Where(x => !x.Equals(targetVar));38 39 IEnumerable<string> allowedInputVars = dataset.DoubleVariables.Where(x => !x.Equals(targetVar)); 41 40 42 41 ITimeSeriesPrognosisProblemData regData = new TimeSeriesPrognosisProblemData(dataset, allowedInputVars, targetVar);
Note: See TracChangeset
for help on using the changeset viewer.