- Timestamp:
- 10/20/09 11:20:13 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassModeller.cs
r2328 r2440 47 47 : base() { 48 48 AddVariableInfo(new VariableInfo(DATASET, "The original dataset and the new dataset parts in the newly created subscopes", typeof(Dataset), VariableKind.In)); 49 AddVariableInfo(new VariableInfo(TARGETVARIABLE, "TargetVariable", typeof( IntData), VariableKind.In));49 AddVariableInfo(new VariableInfo(TARGETVARIABLE, "TargetVariable", typeof(StringData), VariableKind.In)); 50 50 AddVariableInfo(new VariableInfo(TARGETCLASSVALUES, "Class values of the target variable in the original dataset and in the new dataset parts", typeof(ItemList<DoubleData>), VariableKind.In | VariableKind.New)); 51 51 AddVariableInfo(new VariableInfo(CLASSAVALUE, "The original class value of the new class A", typeof(DoubleData), VariableKind.New)); … … 59 59 public override IOperation Apply(IScope scope) { 60 60 Dataset origDataset = GetVariableValue<Dataset>(DATASET, scope, true); 61 int targetVariable = GetVariableValue<IntData>(TARGETVARIABLE, scope, true).Data;61 int targetVariable = origDataset.GetVariableIndex(GetVariableValue<StringData>(TARGETVARIABLE, scope, true).Data); 62 62 ItemList<DoubleData> classValues = GetVariableValue<ItemList<DoubleData>>(TARGETCLASSVALUES, scope, true); 63 63 int origTrainingSamplesStart = GetVariableValue<IntData>(TRAININGSAMPLESSTART, scope, true).Data; -
trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassOneVsOneAnalyzer.cs
r2328 r2440 52 52 : base() { 53 53 AddVariableInfo(new VariableInfo(DATASET, "The dataset to use", typeof(Dataset), VariableKind.In)); 54 AddVariableInfo(new VariableInfo(TARGETVARIABLE, "Target variable", typeof( IntData), VariableKind.In));54 AddVariableInfo(new VariableInfo(TARGETVARIABLE, "Target variable", typeof(StringData), VariableKind.In)); 55 55 AddVariableInfo(new VariableInfo(TARGETCLASSVALUES, "Class values of the target variable in the original dataset", typeof(ItemList<DoubleData>), VariableKind.In)); 56 56 AddVariableInfo(new VariableInfo(CLASSAVALUE, "The original class value of the class A in the subscope", typeof(DoubleData), VariableKind.In)); … … 67 67 public override IOperation Apply(IScope scope) { 68 68 Dataset dataset = GetVariableValue<Dataset>(DATASET, scope, true); 69 int targetVariable = GetVariableValue<IntData>(TARGETVARIABLE, scope, true).Data; 69 string targetVariable = GetVariableValue<StringData>(TARGETVARIABLE, scope, true).Data; 70 int targetVariableIndex = dataset.GetVariableIndex(targetVariable); 70 71 int trainingSamplesStart = GetVariableValue<IntData>(TRAININGSAMPLESSTART, scope, true).Data; 71 72 int trainingSamplesEnd = GetVariableValue<IntData>(TRAININGSAMPLESEND, scope, true).Data; … … 95 96 int correctlyClassified = 0; 96 97 for(int i = 0; i < (samplesEnd - samplesStart); i++) { 97 double originalClassValue = dataset.GetValue(i + samplesStart, targetVariable );98 double originalClassValue = dataset.GetValue(i + samplesStart, targetVariableIndex); 98 99 double estimatedClassValue = classValues[0].Data; 99 100 int maxVotes = votes[i, 0];
Note: See TracChangeset
for help on using the changeset viewer.