Class PKIDiscretize
java.lang.Object
weka.filters.Filter
weka.filters.unsupervised.attribute.PotentialClassIgnorer
weka.filters.unsupervised.attribute.Discretize
weka.filters.unsupervised.attribute.PKIDiscretize
- All Implemented Interfaces:
Serializable,CapabilitiesHandler,CapabilitiesIgnorer,CommandlineRunnable,OptionHandler,RevisionHandler,TechnicalInformationHandler,WeightedAttributesHandler,WeightedInstancesHandler,UnsupervisedFilter
public class PKIDiscretize
extends Discretize
implements TechnicalInformationHandler, WeightedAttributesHandler, WeightedInstancesHandler
Discretizes numeric attributes using equal
frequency binning and forces the number of bins to be equal to the square root of
the number of values of the numeric attribute.
For more information, see:
Ying Yang, Geoffrey I. Webb: Proportional k-Interval Discretization for Naive-Bayes Classifiers. In: 12th European Conference on Machine Learning, 564-575, 2001. BibTeX:
For more information, see:
Ying Yang, Geoffrey I. Webb: Proportional k-Interval Discretization for Naive-Bayes Classifiers. In: 12th European Conference on Machine Learning, 564-575, 2001. BibTeX:
@inproceedings{Yang2001,
author = {Ying Yang and Geoffrey I. Webb},
booktitle = {12th European Conference on Machine Learning},
pages = {564-575},
publisher = {Springer},
series = {LNCS},
title = {Proportional k-Interval Discretization for Naive-Bayes Classifiers},
volume = {2167},
year = {2001}
}
Valid options are:
-unset-class-temporarily Unsets the class index temporarily before the filter is applied to the data. (default: no)
-R <col1,col2-col4,...> Specifies list of columns to discretize. First and last are valid indexes. (default: first-last)
-V Invert matching sense of column indexes.
-D Output binary attributes for discretized attributes.
- Version:
- $Revision: 14508 $
- Author:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the tip text for this propertyReturns the tip text for this propertyintgetBins()IgnoredbooleanGet the value of FindNumBins.String[]Gets the current settings of the filter.Returns the revision string.Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.booleanGet the value of UseEqualFrequency.Returns a string describing this filterGets an enumeration describing the available options.static voidMain method for testing this class.voidsetBins(int numBins) IgnoredvoidsetFindNumBins(boolean newFindNumBins) Set the value of FindNumBins.booleansetInputFormat(Instances instanceInfo) Sets the format of the input instances.voidsetOptions(String[] options) Parses a given list of options.voidsetUseEqualFrequency(boolean newUseEqualFrequency) Set the value of UseEqualFrequency.Returns the tip text for this propertyMethods inherited from class weka.filters.unsupervised.attribute.Discretize
attributeIndicesTipText, batchFinished, binRangePrecisionTipText, desiredWeightOfInstancesPerIntervalTipText, getAttributeIndices, getBinRangePrecision, getBinRangesString, getCapabilities, getCutPoints, getDesiredWeightOfInstancesPerInterval, getInvertSelection, getMakeBinary, getSpreadAttributeWeight, getUseBinNumbers, input, invertSelectionTipText, makeBinaryTipText, setAttributeIndices, setAttributeIndicesArray, setBinRangePrecision, setDesiredWeightOfInstancesPerInterval, setInvertSelection, setMakeBinary, setSpreadAttributeWeight, setUseBinNumbers, spreadAttributeWeightTipText, useBinNumbersTipTextMethods inherited from class weka.filters.unsupervised.attribute.PotentialClassIgnorer
getIgnoreClass, getOutputFormat, ignoreClassTipText, setIgnoreClassMethods inherited from class weka.filters.Filter
batchFilterFile, debugTipText, doNotCheckCapabilitiesTipText, filterFile, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, postExecution, preExecution, run, runFilter, setDebug, setDoNotCheckCapabilities, toString, useFilter, wekaStaticWrapper
-
Constructor Details
-
PKIDiscretize
public PKIDiscretize()
-
-
Method Details
-
setInputFormat
Sets the format of the input instances.- Overrides:
setInputFormatin classDiscretize- Parameters:
instanceInfo- an Instances object containing the input instance structure (any instances contained in the object are ignored - only the structure is required).- Returns:
- true if the outputFormat may be collected immediately
- Throws:
Exception- if the input format can't be set successfully
-
listOptions
Gets an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Overrides:
listOptionsin classDiscretize- Returns:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-unset-class-temporarily Unsets the class index temporarily before the filter is applied to the data. (default: no)
-R <col1,col2-col4,...> Specifies list of columns to discretize. First and last are valid indexes. (default: first-last)
-V Invert matching sense of column indexes.
-D Output binary attributes for discretized attributes.
- Specified by:
setOptionsin interfaceOptionHandler- Overrides:
setOptionsin classDiscretize- Parameters:
options- the list of options as an array of strings- Throws:
Exception- if an option is not supported
-
getOptions
Gets the current settings of the filter.- Specified by:
getOptionsin interfaceOptionHandler- Overrides:
getOptionsin classDiscretize- Returns:
- an array of strings suitable for passing to setOptions
-
globalInfo
Returns a string describing this filter- Overrides:
globalInfoin classDiscretize- Returns:
- a description of the filter suitable for displaying in the explorer/experimenter gui
-
getTechnicalInformation
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
findNumBinsTipText
Returns the tip text for this property- Overrides:
findNumBinsTipTextin classDiscretize- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getFindNumBins
public boolean getFindNumBins()Get the value of FindNumBins.- Overrides:
getFindNumBinsin classDiscretize- Returns:
- Value of FindNumBins.
-
setFindNumBins
public void setFindNumBins(boolean newFindNumBins) Set the value of FindNumBins.- Overrides:
setFindNumBinsin classDiscretize- Parameters:
newFindNumBins- Value to assign to FindNumBins.
-
useEqualFrequencyTipText
Returns the tip text for this property- Overrides:
useEqualFrequencyTipTextin classDiscretize- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getUseEqualFrequency
public boolean getUseEqualFrequency()Get the value of UseEqualFrequency.- Overrides:
getUseEqualFrequencyin classDiscretize- Returns:
- Value of UseEqualFrequency.
-
setUseEqualFrequency
public void setUseEqualFrequency(boolean newUseEqualFrequency) Set the value of UseEqualFrequency.- Overrides:
setUseEqualFrequencyin classDiscretize- Parameters:
newUseEqualFrequency- Value to assign to UseEqualFrequency.
-
binsTipText
Returns the tip text for this property- Overrides:
binsTipTextin classDiscretize- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getBins
public int getBins()Ignored- Overrides:
getBinsin classDiscretize- Returns:
- the number of bins.
-
setBins
public void setBins(int numBins) Ignored- Overrides:
setBinsin classDiscretize- Parameters:
numBins- the number of bins
-
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Overrides:
getRevisionin classDiscretize- Returns:
- the revision
-
main
Main method for testing this class.- Parameters:
argv- should contain arguments to the filter: use -h for help
-