Free cookie consent management tool by TermsFeed Policy Generator

Changeset 131


Ignore:
Timestamp:
04/18/08 15:07:52 (17 years ago)
Author:
gkronber
Message:

changed the StructIdProblemInjector to inject only the training data (between TrainingSamplesStart and TrainingSamplesEnd). As a consequence the two variables start and end are not needed and have been removed.

Location:
trunk/sources/HeuristicLab.StructureIdentification
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.StructureIdentification/StructIdProblemInjector.cs

    r77 r131  
    4646      AddVariableInfo(new VariableInfo("MaxTreeSize", "MaxTreeSize", typeof(IntData), VariableKind.New));
    4747      AddVariable(new Variable("MaxTreeSize", new IntData(1)));
    48       AddVariableInfo(new VariableInfo("TrainingSamplesStart", "First sample to evaluate in training", typeof(IntData), VariableKind.New));
    49       AddVariable(new Variable("TrainingSamplesStart", new IntData(0)));
    50       AddVariableInfo(new VariableInfo("TrainingSamplesEnd", "Last sample to evaluate in training", typeof(IntData), VariableKind.New));
    51       AddVariable(new Variable("TrainingSamplesEnd", new IntData(0)));
    5248    }
    5349
     
    6258      scope.AddVariable(new Variable(scope.TranslateName("MaxTreeHeight"), (IItem)GetVariable("MaxTreeHeight").Value.Clone()));
    6359      scope.AddVariable(new Variable(scope.TranslateName("MaxTreeSize"), (IItem)GetVariable("MaxTreeSize").Value.Clone()));
    64       scope.AddVariable(new Variable(scope.TranslateName("TrainingSamplesStart"), (IItem)GetVariable("TrainingSamplesStart").Value.Clone()));
    65       scope.AddVariable(new Variable(scope.TranslateName("TrainingSamplesEnd"), (IItem)GetVariable("TrainingSamplesEnd").Value.Clone()));
    6660      return null;
    6761    }
  • trunk/sources/HeuristicLab.StructureIdentification/StructIdProblemInjectorView.cs

    r2 r131  
    8888        if (success) {
    8989          Dataset dataset = (Dataset)StructIdProblemInjector.GetVariable("Dataset").Value;
    90           dataset.Rows = parser.Rows;
     90          dataset.Rows = parser.TrainingSamplesEnd - parser.TrainingSamplesStart;
    9191          dataset.Columns = parser.Columns;
    9292          dataset.VariableNames = parser.VariableNames;
    9393          dataset.Name = parser.ProblemName;
    94           dataset.Samples = parser.Samples;
     94          dataset.Samples = new double[dataset.Rows * dataset.Columns];
     95          Array.Copy(parser.Samples, dataset.Samples, dataset.Columns * dataset.Rows);
    9596
    9697          ((IntData)StructIdProblemInjector.GetVariable("TargetVariable").Value).Data = parser.TargetVariable;
    9798          ((IntData)StructIdProblemInjector.GetVariable("MaxTreeHeight").Value).Data = parser.MaxTreeHeight;
    9899          ((IntData)StructIdProblemInjector.GetVariable("MaxTreeSize").Value).Data = parser.MaxTreeSize;
    99           ((IntData)StructIdProblemInjector.GetVariable("TrainingSamplesStart").Value).Data = parser.TrainingSamplesStart;
    100           ((IntData)StructIdProblemInjector.GetVariable("TrainingSamplesEnd").Value).Data = parser.TrainingSamplesEnd;
    101100          Refresh();
    102101        }
Note: See TracChangeset for help on using the changeset viewer.