Bayes and CBayes classifier is implemented as extension of AbstractVectorClassifier.
In the current version, I had to make the following hacks /** * Returns the number of categories for the target variable. A vector classifier * will encode it's output using a zero-based 1 of numCategories encoding. * @return The number of categories. */ public abstract int numCategories(); return number of labels; /** * Classify a vector returning a vector of numCategories-1 scores. It is assumed that * the score for the missing category is one minus the sum of the scores that are returned. * * Note that the missing score is the 0-th score. * @param instance A feature vector to be classified. * @return A vector of probabilities in 1 of n-1 encoding. */ public abstract Vector classify(Vector instance); The classifier scores are converted to 0-1 score as ratios(clearly, they are not probabilities) What should I do here? /** * Classifies a vector in the special case of a binary classifier where * <code>classify(Vector)</code> would return a vector with only one element. As such, * using this method can void the allocation of a vector. * @param instance The feature vector to be classified. * @return The score for category 1. * * @see #classify(Vector) */ public abstract double classifyScalar(Vector instance); This returns unsuported operation exception /** * Classify a vector, but don't apply the inverse link function. For logistic regression * and other generalized linear models, this is just the linear part of the classification. * @param features A feature vector to be classified. * @return A vector of scores. If transformed by the link function, these will become probabilities. */ public Vector classifyNoLink(Vector features); This returns the scores of each class label in the vector ===================== Since there is not online learning, I need a batch trainer interface or not? Is there any interface defined for loading and saving Model ? More questions later
