Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/20/09 12:59:31 (16 years ago)
Author:
gkronber
Message:

adapted SVMEvaluator to work with simple evaluators of plugin Modeling. #635

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorEvaluator.cs

    r1837 r1870  
    4343      AddVariableInfo(new VariableInfo("SVMRangeTransform", "The applied transformation during the learning the model", typeof(SVMRangeTransform), VariableKind.In));
    4444
    45       AddVariableInfo(new VariableInfo("Values", "Target vs predicted values", typeof(ItemList), VariableKind.New | VariableKind.Out));
     45      AddVariableInfo(new VariableInfo("Values", "Target vs predicted values", typeof(DoubleMatrixData), VariableKind.New | VariableKind.Out));
    4646    }
    4747
     
    6060      SVM.Problem scaledProblem = SVM.Scaling.Scale(problem, rangeTransform);
    6161
    62       ItemList predictedValues = new ItemList();
    63       ItemList row;
     62      double[,] values = new double[end-start, 2];
    6463      for (int i = 0; i < end - start; i++) {
    65         row = new ItemList();
    66         row.Add(new DoubleData(SVM.Prediction.Predict(model, scaledProblem.X[i])));
    67         row.Add(new DoubleData(dataset.Samples[(start + i) * dataset.Columns + targetVariable]));
    68         predictedValues.Add(row);
     64        values[i,0] = SVM.Prediction.Predict(model, scaledProblem.X[i]);
     65        values[i,1] = dataset.Samples[(start + i) * dataset.Columns + targetVariable];
    6966      }
    7067
    71       scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("Values"), predictedValues));
     68      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("Values"), new DoubleMatrixData(values)));
    7269      return null;
    7370    }
Note: See TracChangeset for help on using the changeset viewer.