Changeset 1870
- Timestamp:
- 05/20/09 12:59:31 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorEvaluator.cs
r1837 r1870 43 43 AddVariableInfo(new VariableInfo("SVMRangeTransform", "The applied transformation during the learning the model", typeof(SVMRangeTransform), VariableKind.In)); 44 44 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)); 46 46 } 47 47 … … 60 60 SVM.Problem scaledProblem = SVM.Scaling.Scale(problem, rangeTransform); 61 61 62 ItemList predictedValues = new ItemList(); 63 ItemList row; 62 double[,] values = new double[end-start, 2]; 64 63 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]; 69 66 } 70 67 71 scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("Values"), predictedValues));68 scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("Values"), new DoubleMatrixData(values))); 72 69 return null; 73 70 }
Note: See TracChangeset
for help on using the changeset viewer.