Changeset 9494 for branches/LearningClassifierSystems/HeuristicLab.Problems.VariableVectorClassification
- Timestamp:
- 05/14/13 16:54:01 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Problems.VariableVectorClassification/3.3/VariableVectorClassificationProblemData.cs
r9475 r9494 74 74 public VariableVectorClassificationProblemData(Dataset dataset, IEnumerable<string> allowedConditionVariables, IEnumerable<string> allowedActionVariables) : 75 75 base(dataset, allowedConditionVariables, allowedActionVariables) { 76 Parameters.Add(new ValueParameter<VariableVector>("SampleVariableVector", "", GenerateSampleVariableVector(dataset, allowedConditionVariables, allowedActionVariables)));76 Parameters.Add(new ValueParameter<VariableVector>("SampleVariableVector", "", GenerateSampleVariableVector(dataset, AllowedConditionVariables, AllowedActionVariables))); 77 77 Parameters.Add(new FixedValueParameter<PercentValue>("SpreadPercentage", "", new PercentValue(0.5))); 78 } 79 80 protected override CheckedItemList<StringValue> CheckVariablesForPossibleTargetVariables(Dataset dataset) { 81 var allVariables = GetVariablesOfDataSet(dataset, dataset.VariableNames).Where(v => v is StringVariable || v is IntVariable).Select(v => new StringValue(v.VariableName)); 82 return new CheckedItemList<StringValue>(allVariables); 78 83 } 79 84 … … 81 86 var conditionVariables = GetVariablesOfDataSet(dataset, allowedConditionVariables); 82 87 var actionVariables = GetVariablesOfDataSet(dataset, allowedActionVariables); 83 if ( actionVariables.Count() == 0 ||!actionVariables.All(x => x is IActionVariable)) {88 if (!actionVariables.All(x => x is IActionVariable)) { 84 89 throw new ArgumentException("Action variable can not be empty and all action variables have to be of type int or string."); 85 90 } … … 87 92 } 88 93 89 private IEnumerable<Encodings.VariableVector.IVariable> GetVariablesOfDataSet(Data Analysis.Dataset dataset, IEnumerable<string> allowedVariables) {94 private IEnumerable<Encodings.VariableVector.IVariable> GetVariablesOfDataSet(Dataset dataset, IEnumerable<string> allowedVariables) { 90 95 var variables = new List<HeuristicLab.Encodings.VariableVector.IVariable>(); 91 96 foreach (var variableName in allowedVariables) {
Note: See TracChangeset
for help on using the changeset viewer.