(DataPoint data)
| 52 | } |
| 53 | |
| 54 | @Override |
| 55 | public CategoricalResults classify(DataPoint data) |
| 56 | { |
| 57 | if(predicting == null) |
| 58 | throw new RuntimeException("Classifier has not been trained yet"); |
| 59 | CategoricalResults cr = new CategoricalResults(predicting.getNumOfCategories()); |
| 60 | |
| 61 | for(int i=0; i < hypoths.size(); i++) |
| 62 | cr.incProb(hypoths.get(i).classify(data).mostLikely(), hypWeights.get(i)); |
| 63 | |
| 64 | cr.normalize(); |
| 65 | return cr; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * |