public class PredictiveApriori extends AbstractAssociator implements OptionHandler, CARuleMiner, TechnicalInformationHandler
@inproceedings{Scheffer2001, author = {Tobias Scheffer}, booktitle = {5th European Conference on Principles of Data Mining and Knowledge Discovery}, pages = {424-435}, publisher = {Springer}, title = {Finding Association Rules That Trade Support Optimally against Confidence}, year = {2001} }Valid options are:
-N <required number of rules output> The required number of rules. (default = 100)
-A If set class association rules are mined. (default = no)
-c <the class index> The class index. (default = last)
Constructor and Description |
---|
PredictiveApriori()
Constructor that allows to sets default values for the
minimum confidence and the maximum number of rules
the minimum confidence.
|
Modifier and Type | Method and Description |
---|---|
void |
buildAssociations(Instances instances)
Method that generates all large itemsets with a minimum support, and from
these all association rules.
|
String |
carTipText()
Returns the tip text for this property
|
String |
classIndexTipText()
Returns the tip text for this property
|
FastVector[] |
getAllTheRules()
returns all the rules
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
boolean |
getCar()
Gets whether class association ruels are mined
|
int |
getClassIndex()
Gets the index of the class attribute
|
Instances |
getInstancesNoClass()
Gets the instances without the class attribute
|
Instances |
getInstancesOnlyClass()
Gets the class attribute of all instances
|
int |
getNumRules()
Get the value of the number of required rules.
|
String[] |
getOptions()
Gets the current settings of the PredictiveApriori object.
|
String |
getRevision()
Returns the revision string.
|
TechnicalInformation |
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.
|
String |
globalInfo()
Returns a string describing this associator
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] args)
Main method.
|
String |
metricString()
Returns the metric string for the chosen metric type.
|
FastVector[] |
mineCARs(Instances data)
Method that mines the n best class association rules.
|
String |
numRulesTipText()
Returns the tip text for this property
|
void |
resetOptions()
Resets the options to the default values.
|
void |
setCar(boolean flag)
Sets class association rule mining
|
void |
setClassIndex(int index)
Sets the class index
|
void |
setNumRules(int v)
Set the value of required rules.
|
void |
setOptions(String[] options)
Parses a given list of options.
|
String |
toString()
Outputs the association rules.
|
forName, makeCopies, makeCopy
public PredictiveApriori()
public String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public void resetOptions()
public Capabilities getCapabilities()
getCapabilities
in interface Associator
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractAssociator
Capabilities
public void buildAssociations(Instances instances) throws Exception
buildAssociations
in interface Associator
instances
- the instances to be used for generating the associationsException
- if rules can't be built successfullypublic FastVector[] mineCARs(Instances data) throws Exception
mineCARs
in interface CARuleMiner
data
- the instances for which class association rules should be minedException
- if rules can't be built successfullypublic Instances getInstancesNoClass()
getInstancesNoClass
in interface CARuleMiner
public Instances getInstancesOnlyClass()
getInstancesOnlyClass
in interface CARuleMiner
public Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(String[] options) throws Exception
-N <required number of rules output> The required number of rules. (default = 100)
-A If set class association rules are mined. (default = no)
-c <the class index> The class index. (default = last)
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
public String toString()
public String numRulesTipText()
public int getNumRules()
public void setNumRules(int v)
v
- Value to assign to number of required rules.public void setClassIndex(int index)
setClassIndex
in interface CARuleMiner
index
- the index of the class attributepublic int getClassIndex()
public String classIndexTipText()
public void setCar(boolean flag)
flag
- if class association rules are mined, false otherwisepublic boolean getCar()
public String carTipText()
public String metricString()
metricString
in interface CARuleMiner
public FastVector[] getAllTheRules()
m_allTheRules
public String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractAssociator
public static void main(String[] args)
args
- the commandline parametersCopyright © 2019 University of Waikato, Hamilton, NZ. All rights reserved.