Changeset 2174 for trunk/sources/HeuristicLab.Modeling
- Timestamp:
- 07/20/09 20:14:47 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Modeling/3.2/ProblemInjector.cs
r2165 r2174 78 78 AddVariableInfo(new VariableInfo("MaxNumberOfTrainingSamples", "Maximal number of training samples to use (optional)", typeof(IntData), VariableKind.In)); 79 79 AddVariableInfo(new VariableInfo("NumberOfInputVariables", "The number of available input variables", typeof(IntData), VariableKind.New)); 80 AddVariableInfo(new VariableInfo("InputVariables", "List of input variable names", typeof(ItemList), VariableKind.New)); 80 81 } 81 82 … … 97 98 98 99 Dataset scopeDataset = CreateNewDataset(operatorDataset, targetVariable, operatorAllowedFeatures); 100 ItemList inputVariables = new ItemList(); 101 for (int i = 1; i < scopeDataset.Columns; i++) { 102 inputVariables.Add(new StringData(scopeDataset.GetVariableName(i))); 103 } 99 104 100 scope.AddVariable(new Variable("Dataset", scopeDataset)); 101 scope.AddVariable(new Variable("TargetVariable", new IntData(0))); 102 scope.AddVariable(new Variable("NumberOfInputVariables", new IntData(scopeDataset.Columns - 1))); 105 scope.AddVariable(new Variable(scope.TranslateName("Dataset"), scopeDataset)); 106 scope.AddVariable(new Variable(scope.TranslateName("TargetVariable"), new IntData(0))); 107 scope.AddVariable(new Variable(scope.TranslateName("NumberOfInputVariables"), new IntData(scopeDataset.Columns - 1))); 108 scope.AddVariable(new Variable(scope.TranslateName("InputVariables"), inputVariables)); 103 109 104 110 int trainingStart = GetVariableValue<IntData>("TrainingSamplesStart", scope, true).Data; … … 116 122 scope.AddVariable(new Variable(scope.TranslateName("ActualTrainingSamplesStart"), new IntData(trainingStart))); 117 123 scope.AddVariable(new Variable(scope.TranslateName("ActualTrainingSamplesEnd"), new IntData(trainingStart + nTrainingSamples))); 124 125 118 126 return null; 119 127 } … … 154 162 155 163 private void AddVariableToScope(string variableName, IScope scope) { 156 scope.AddVariable(new Variable( variableName, (IItem)GetVariable(variableName).Value.Clone()));164 scope.AddVariable(new Variable(scope.TranslateName(variableName), (IItem)GetVariable(variableName).Value.Clone())); 157 165 } 158 166 }
Note: See TracChangeset
for help on using the changeset viewer.