Changeset 2412 for trunk/sources/HeuristicLab.SupportVectorMachines
- Timestamp:
- 10/06/09 09:49:51 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.SupportVectorMachines/3.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/Predictor.cs
r2381 r2412 75 75 } 76 76 77 77 78 Problem p = SVMHelper.CreateSVMProblem(input, input.GetVariableIndex(targetVariable), newIndex, 78 79 start, end, minTimeOffset, maxTimeOffset); 79 80 Problem scaledProblem = SVM.Scaling.Scale(p, transform); 80 81 82 int targetVariableIndex = input.GetVariableIndex(targetVariable); 81 83 int rows = end - start; 82 int columns = input.Columns;83 84 double[] result = new double[rows]; 84 for (int row = 0; row < rows; row++) { 85 result[row] = Math.Max(Math.Min(SVM.Prediction.Predict(model, scaledProblem.X[row]), UpperPredictionLimit), LowerPredictionLimit); 85 int problemRow = 0; 86 for (int resultRow = 0; resultRow < rows; resultRow++) { 87 if (double.IsNaN(input.GetValue(resultRow, targetVariableIndex))) 88 result[resultRow] = UpperPredictionLimit; 89 else 90 result[resultRow] = Math.Max(Math.Min(SVM.Prediction.Predict(model, scaledProblem.X[problemRow++]), UpperPredictionLimit), LowerPredictionLimit); 86 91 } 87 92 return result; -
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMHelper.cs
r2349 r2412 24 24 } 25 25 26 int maxColumns = (dataset.Columns - skippedFeatures.Count()) * (maxTimeOffset - minTimeOffset + 1);26 int maxColumns = 0; 27 27 28 28 double[] targetVector = new double[rowCount]; … … 44 44 int actualColumn = columnMapping[col] * (maxTimeOffset - minTimeOffset + 1) + (timeOffset - minTimeOffset); 45 45 double value = dataset.GetValue(start + row + timeOffset, col); 46 if (!double.IsNaN(value)) 46 if (!double.IsNaN(value)) { 47 47 tempRow.Add(new SVM.Node(actualColumn, value)); 48 if (actualColumn > maxColumns) maxColumns = actualColumn; 49 } 48 50 } 49 51 }
Note: See TracChangeset
for help on using the changeset viewer.