L
- The type of the labels in the ClassifierF
- The type of the features in the Classifierpublic class NBLinearClassifierFactory<L,F> extends AbstractLinearClassifierFactory<L,F>
Constructor and Description |
---|
NBLinearClassifierFactory()
Create a ClassifierFactory.
|
NBLinearClassifierFactory(double sigma)
Create a ClassifierFactory.
|
NBLinearClassifierFactory(double sigma,
boolean interpretAlwaysOnFeatureAsPrior)
Create a ClassifierFactory.
|
Modifier and Type | Method and Description |
---|---|
void |
setTuneSigmaCV(int folds)
setTuneSigmaCV sets the
tuneSigma flag: when turned on,
the sigma is tuned by cross-validation. |
protected double[][] |
trainWeights(GeneralDataset<L,F> data) |
trainClassifier, trainClassifier, trainClassifier, trainClassifier
public NBLinearClassifierFactory()
public NBLinearClassifierFactory(double sigma)
sigma
- The amount of add-sigma smoothing of evidencepublic NBLinearClassifierFactory(double sigma, boolean interpretAlwaysOnFeatureAsPrior)
sigma
- The amount of add-sigma smoothing of evidenceinterpretAlwaysOnFeatureAsPrior
- If true, a feature that is in every
data item is interpreted as an indication to include a prior
factor over classes. (If there are multiple such features, an
integral "prior boost" will occur.) If false, an always on
feature is interpreted as an evidence feature (and, following
the standard math) will have no effect on the model.protected double[][] trainWeights(GeneralDataset<L,F> data)
trainWeights
in class AbstractLinearClassifierFactory<L,F>
public void setTuneSigmaCV(int folds)
tuneSigma
flag: when turned on,
the sigma is tuned by cross-validation.
If there is less data than the number of folds, leave-one-out is used.
The default for tuneSigma is false.folds
- Number of folds for cross validation