Ignore:
Timestamp:
07/09/10 17:01:36 (11 years ago)
Author:
gkronber
Message:

Worked on symbolic regression classes to prepare for time series prognosis plugin. #1081

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs

    r3933 r4022  
    3939    #region default data
    4040    // y = x^4 + x^3 + x^2 + x
    41     private readonly double[,] kozaF1 = new double[,] {
     41    private static double[,] kozaF1 = new double[,] {
    4242{2.017885919, -1.449165046},
    4343{1.30060506,  -1.344523885},
     
    185185    }
    186186
     187    public DataAnalysisProblemData(Dataset dataset, IEnumerable<string> inputVariables, string targetVariable,
     188      int trainingSamplesStart, int trainingSamplesEnd, int testSamplesStart, int testSamplesEnd) {
     189      var inputVariablesList = new CheckedItemList<StringValue>(inputVariables.Select(x => new StringValue(x)));
     190      StringValue targetVariableValue = new StringValue(targetVariable);
     191      var validTargetVariables = new ItemSet<StringValue>();
     192      foreach (var variable in dataset.VariableNames)
     193        if (variable != targetVariable)
     194          validTargetVariables.Add(new StringValue(variable));
     195      validTargetVariables.Add(targetVariableValue);
     196      Parameters.Add(new ValueParameter<Dataset>("Dataset", dataset));
     197      Parameters.Add(new ValueParameter<ICheckedItemList<StringValue>>("InputVariables", inputVariablesList.AsReadOnly()));
     198      Parameters.Add(new ConstrainedValueParameter<StringValue>("TargetVariable", validTargetVariables, targetVariableValue));
     199      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesStart", new IntValue(trainingSamplesStart)));
     200      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesEnd", new IntValue(trainingSamplesEnd)));
     201      Parameters.Add(new ValueParameter<IntValue>("TestSamplesStart", new IntValue(testSamplesStart)));
     202      Parameters.Add(new ValueParameter<IntValue>("TestSamplesEnd", new IntValue(testSamplesEnd)));
     203      RegisterParameterEventHandlers();
     204      RegisterParameterValueEventHandlers();
     205    }
    187206
    188207    [StorableConstructor]
Note: See TracChangeset for help on using the changeset viewer.