public class ClassConditionalProbabilities extends SimpleBatchFilter implements WeightedAttributesHandler, WeightedInstancesHandler
-N Don't apply this transformation to numeric attributes
-C Don't apply this transformation to nominal attributes
-min-values <integer> Transform nominal attributes with at least this many values. -1 means always transform.
-output-debug-info If set, filter is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, filter capabilities are not checked before filter is built (use with caution).
-spread-attribute-weight When generating binary attributes, spread weight of old attribute across new attributes. Do not give each new attribute the old weight.
Constructor and Description |
---|
ClassConditionalProbabilities() |
Modifier and Type | Method and Description |
---|---|
Capabilities |
getCapabilities()
Returns the Capabilities of this filter.
|
NaiveBayes |
getEstimator()
Get the naive Bayes estimator in use
|
boolean |
getExcludeNominalAttributes()
Get whether nominal attributes are to be excluded from the transformation
|
boolean |
getExcludeNumericAttributes()
Get whether numeric attributes are being excluded from the transformation
|
int |
getNominalConversionThreshold()
Get the minimum number of values a nominal attribute must have in order to
be transformed.
|
Remove |
getRemoveFilter()
Get the remove filter in use
|
java.lang.String |
getRevision()
Returns the revision string.
|
boolean |
getSpreadAttributeWeight()
If true, when generating attributes, spread weight of old
attribute across new attributes.
|
java.lang.String |
globalInfo()
Global help info for this method
|
boolean |
input(Instance inst)
Input an instance for filtering.
|
static void |
main(java.lang.String[] args)
Main method for testing this class
|
void |
setEstimator(NaiveBayes nb)
Set the naive Bayes estimator to use
|
void |
setExcludeNominalAttributes(boolean e)
Set whether nominal attributes are to be excluded from the transformation
|
void |
setExcludeNumericAttributes(boolean e)
Set whether numeric attributes are being excluded from the transformation
|
void |
setNominalConversionThreshold(int n)
Set the minimum number of values a nominal attribute must have in order to
be transformed.
|
void |
setRemoveFilter(Remove r) |
void |
setSpreadAttributeWeight(boolean p)
If true, when generating attributes, spread weight of old
attribute across new attributes.
|
allowAccessToFullInputFormat, batchFinished, input
setInputFormat
batchFilterFile, debugTipText, doNotCheckCapabilitiesTipText, filterFile, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, getOptions, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, listOptions, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, postExecution, preExecution, run, runFilter, setDebug, setDoNotCheckCapabilities, setOptions, toString, useFilter, wekaStaticWrapper
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public static void main(java.lang.String[] args)
args
- argspublic java.lang.String globalInfo()
globalInfo
in class SimpleFilter
@OptionMetadata(displayName="Exclude numeric attributes", description="Don\'t apply this transformation to numeric attributes", commandLineParamName="N", commandLineParamIsFlag=true, commandLineParamSynopsis="-N", displayOrder=1) public boolean getExcludeNumericAttributes()
public void setExcludeNumericAttributes(boolean e)
e
- true if numeric attributes are to be excluded@OptionMetadata(displayName="Exclude nominal attributes", description="Don\'t apply this transformation to nominal attributes", commandLineParamName="C", commandLineParamIsFlag=true, commandLineParamSynopsis="-C", displayOrder=2) public boolean getExcludeNominalAttributes()
public void setExcludeNominalAttributes(boolean e)
e
- true if nominal attributes are to be excluded@OptionMetadata(displayName="Spread weight across new attributes", description="When generating attributes, spread weight of old\nattribute across new attributes. Do not give each new attribute the old weight.", commandLineParamName="spread-attribute-weight", commandLineParamIsFlag=true, commandLineParamSynopsis="-spread-attribute-weight", displayOrder=3) public void setSpreadAttributeWeight(boolean p)
p
- whether weight is spreadpublic boolean getSpreadAttributeWeight()
@OptionMetadata(displayName="Nominal conversion threshold", description="Transform nominal attributes with at least this many values.\n-1 means always transform.", commandLineParamName="min-values", commandLineParamSynopsis="-min-values <integer>", displayOrder=3) public int getNominalConversionThreshold()
public void setNominalConversionThreshold(int n)
n
- the number of values of a nominal attribute after which the
transformation appliespublic boolean input(Instance inst) throws java.lang.Exception
SimpleBatchFilter
input
in class SimpleBatchFilter
inst
- the input instancejava.lang.IllegalStateException
- if no input structure has been definedjava.lang.Exception
- if something goes wrongSimpleBatchFilter.batchFinished()
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Filter
@ProgrammaticProperty public NaiveBayes getEstimator()
public void setEstimator(NaiveBayes nb)
nb
- the naive Bayes estimator to use@ProgrammaticProperty public Remove getRemoveFilter()
public void setRemoveFilter(Remove r)