- Timestamp:
- 09/03/09 15:00:23 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/Predictor.cs
r2290 r2328 32 32 33 33 namespace HeuristicLab.SupportVectorMachines { 34 public class Predictor : ItemBase, IPredictor{34 public class Predictor : PredictorBase { 35 35 private SVMModel svmModel; 36 public SVMModel Model { 37 get { return svmModel; } 38 } 39 36 40 private Dictionary<string, int> variableNames = new Dictionary<string, int>(); 37 41 private string targetVariable; … … 46 50 } 47 51 48 public double[] Predict(Dataset input, int start, int end) {52 public override double[] Predict(Dataset input, int start, int end) { 49 53 if (start < 0 || end <= start) throw new ArgumentException("start must be larger than zero and strictly smaller than end"); 50 54 if (end > input.Rows) throw new ArgumentOutOfRangeException("number of rows in input is smaller then end"); … … 64 68 double[] result = new double[rows]; 65 69 for (int row = 0; row < rows; row++) { 66 result[row] = SVM.Prediction.Predict(model, scaledProblem.X[row]);70 result[row] = Math.Max(Math.Min(SVM.Prediction.Predict(model, scaledProblem.X[row]), UpperPredictionLimit), LowerPredictionLimit); 67 71 } 68 72 return result; … … 70 74 71 75 public override IView CreateView() { 72 return svmModel.CreateView();76 return new PredictorView(this); 73 77 } 74 78
Note: See TracChangeset
for help on using the changeset viewer.