|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.filters.Filter
weka.filters.unsupervised.instance.Denormalize
public class Denormalize
An instance filter that collapses instances with a common grouping ID value into a single instance. Useful for converting transactional data into a format that Weka's association rule learners can handle. IMPORTANT: assumes that the incoming batch of instances has been sorted on the grouping attribute. The values of nominal attributes are converted to indicator attributes. These can be either binary (with f and t values) or unary with missing values used to indicate absence. The later is Weka's old market basket format, which is useful for Apriori. Numeric attributes can be aggregated within groups by computing the average, sum, minimum or maximum.
Valid options are:-G <index | name | first | last> Index or name of attribute to group by. e.g. transaction ID (default: first)
-B Output instances in Weka's old market basket format (i.e. unary attributes with absence indicated by missing values.
-S Output sparse instances (can't be used in conjunction with -B)
-A <Average | Sum | Maximum | Minimum> Aggregation function for numeric attributes. (default: sum).
Nested Class Summary | |
---|---|
static class |
Denormalize.NumericAggregation
Enumeration of the aggregation methods for numeric attributes |
Field Summary | |
---|---|
static Tag[] |
TAGS_SELECTION
tags |
Constructor Summary | |
---|---|
Denormalize()
|
Method Summary | |
---|---|
java.lang.String |
aggregationTypeTipText()
Returns a description of this option suitable for display as a tip text in the gui. |
boolean |
batchFinished()
Signify that this batch of input to the filter is finished. |
SelectedTag |
getAggregationType()
Get the type of aggregation to use on numeric values withn a group. |
Capabilities |
getCapabilities()
Returns the Capabilities of this filter. |
java.lang.String |
getGroupingAttribute()
Get the name/index of the attribute to be used for grouping rows (tranasactions). |
java.lang.String[] |
getOptions()
Gets the current settings of the filter. |
java.lang.String |
getRevision()
Returns the revision string. |
boolean |
getUseOldMarketBasketFormat()
Gets whether data is to be output in Weka's old market basket format. |
boolean |
getUseSparseFormat()
Get whether sparse data is to be output. |
java.lang.String |
globalInfo()
Returns a string describing this associator |
java.lang.String |
groupingAttributeTipText()
Returns a description of this option suitable for display as a tip text in the gui. |
boolean |
input(Instance instance)
Input an instance for filtering. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] args)
Main method for testing this class. |
void |
setAggregationType(SelectedTag d)
Set the type of aggregation to use on numeric values within a group. |
void |
setGroupingAttribute(java.lang.String groupAtt)
Set the name or index of the attribute to use for grouping rows (transactions). |
boolean |
setInputFormat(Instances instanceInfo)
Sets the format of the input instances. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setUseOldMarketBasketFormat(boolean m)
Set whether to output data in Weka's old market basket format. |
void |
setUseSparseFormat(boolean s)
Set whether to output sparse data. |
java.lang.String |
useOldMarketBasketFormatTipText()
Returns a description of this option suitable for display as a tip text in the gui. |
java.lang.String |
useSparseFormatTipText()
Returns a description of this option suitable for display as a tip text in the gui. |
Methods inherited from class weka.filters.Filter |
---|
batchFilterFile, filterFile, getCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, runFilter, toString, useFilter, wekaStaticWrapper |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Tag[] TAGS_SELECTION
Constructor Detail |
---|
public Denormalize()
Method Detail |
---|
public java.lang.String globalInfo()
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Filter
Capabilities
public boolean setInputFormat(Instances instanceInfo) throws java.lang.Exception
setInputFormat
in class Filter
instanceInfo
- an Instances object containing the input instance
structure (any instances contained in the object are ignored - only the
structure is required).
java.lang.Exception
- if the inputFormat can't be set successfullypublic boolean input(Instance instance) throws java.lang.Exception
input
in class Filter
instance
- the input instance
java.lang.IllegalStateException
- if no input format has been defined.
java.lang.Exception
public boolean batchFinished() throws java.lang.Exception
batchFinished
in class Filter
java.lang.IllegalStateException
- if no input structure has been defined
java.lang.Exception
public java.lang.String groupingAttributeTipText()
public void setGroupingAttribute(java.lang.String groupAtt)
groupAtt
- the name/index of the attribute to use for
groupingpublic java.lang.String getGroupingAttribute()
public void setUseOldMarketBasketFormat(boolean m)
m
- true if data is to be output in Weka's old market basket format.public boolean getUseOldMarketBasketFormat()
public java.lang.String useOldMarketBasketFormatTipText()
public void setUseSparseFormat(boolean s)
s
- true if sparse data is to be output.public boolean getUseSparseFormat()
public java.lang.String useSparseFormatTipText()
public void setAggregationType(SelectedTag d)
d
- the type of aggregation to use for numeric values.public SelectedTag getAggregationType()
public java.lang.String aggregationTypeTipText()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-G <index | name | first | last> Index or name of attribute to group by. e.g. transaction ID (default: first)
-B Output instances in Weka's old market basket format (i.e. unary attributes with absence indicated by missing values.
-S Output sparse instances (can't be used in conjunction with -B)
-A <Average | Sum | Maximum | Minimum> Aggregation function for numeric attributes. (default: sum).
setOptions
in interface OptionHandler
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Filter
public static void main(java.lang.String[] args)
args
- should contain arguments to the filter: use -h for help
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |