public class Itemset
extends java.lang.Object
implements java.lang.Comparable
Constructor and Description |
---|
Itemset()
Default Constructor.
|
Itemset(int clas)
Parameters Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Item item)
Function to add an item to our itemset.
|
void |
calculateSupports(myDataset train)
It computes the support, rule support, hits, misses and PER of our itemset for a given dataset.
|
Itemset |
clone()
Clone function.
|
int |
compareTo(java.lang.Object a)
Function to compare objects of the Itemset class.
|
Item |
get(int pos)
It returns the item located in the given position of the itemset.
|
int |
getClas()
It returns the output class of the itemset.
|
int |
getHits()
It returns the number of hits of the itemset against the training set.
|
int |
getMisses()
It returns the number of misses of the itemset against the training set.
|
double |
getPer()
It returns the Pessimistic Error Rate of the itemset.
|
double |
getSupport()
It returns the support of the antecedent of the itemset.
|
double |
getSupportClass()
It returns the support of the itemset for its related output class.
|
boolean |
isEqual(Itemset a)
Function to check if an itemset is equal to another given.
|
boolean |
isEqualAnt(Itemset a)
Function to check if the antecedent of our itemset is equal to another given.
|
boolean |
isSubItemset(Itemset a)
Function to check if our itemset is Subitemset (can be contained) of a given itemset.
|
Item |
remove(int pos)
Function to remove the item located in the given position.
|
void |
setClas(int clas)
Function which sets the itemset's output class.
|
int |
size()
It returns the size of the itemset (the number of items it has).
|
public Itemset()
public Itemset(int clas)
clas
- Associated output of the Itemsetpublic Itemset clone()
clone
in class java.lang.Object
public void add(Item item)
item
- Element to be addedpublic Item get(int pos)
pos
- Position of the requested item into the itemsetpublic Item remove(int pos)
pos
- Position of the requested item into the itemsetpublic int size()
public double getSupport()
public double getSupportClass()
public int getHits()
public int getMisses()
It returns the number of misses of the itemset against the training set.
public double getPer()
public int getClas()
public void setClas(int clas)
clas
- Itemset's output classpublic boolean isEqual(Itemset a)
a
- Itemset to compare with ourspublic boolean isEqualAnt(Itemset a)
a
- Itemset which antecedents we are going to compare with ourspublic boolean isSubItemset(Itemset a)
a
- Itemset to check if can contain ourspublic void calculateSupports(myDataset train)
train
- Given training dataset to be able to calculate supportspublic int compareTo(java.lang.Object a)
compareTo
in interface java.lang.Comparable
a
- Itemset object to compare with.