public class Itemset
extends java.lang.Object
Class to manipulate an itemset.
Modifier and Type | Field and Description |
---|---|
protected MyDataset |
dataset
The dataset which the itemset has access to.
|
protected static double |
MISSING_VALUE
Constant that represents the missing value.
|
protected double[] |
values
Values of the itemset.
|
protected double |
weight
The weight of the itemset.
|
Constructor and Description |
---|
Itemset(double w,
double[] attributeValues)
Constructor that sets the values and the weight.
|
Itemset(Itemset itemset)
Constructor that copies the values and the weight.
|
Modifier and Type | Method and Description |
---|---|
int |
classIndex()
Returns the index of the class attribute.
|
boolean |
classIsMissing()
Function to test if the class attribute is missing.
|
java.lang.Object |
copy()
Function to copy an itemset.
|
MyAttribute |
getAttribute(int index)
Returns the attribute with the given index.
|
double |
getClassValue()
Returns the index of the value of the class.
|
MyDataset |
getDataset()
Returns the dataset of this itemset.
|
static double |
getMissingValue()
Returns the missing value.
|
double |
getValue(int index)
Returns the value of the given attribute.
|
double |
getWeight()
Returns the itemset weight.
|
boolean |
isMissing(int index)
Function to check if a value is missing.
|
static boolean |
isMissingValue(double val)
Function to check if the value given is the missing value.
|
int |
numClasses()
Returns the number of class values.
|
void |
setClassMissing()
Function to set as missing the class value.
|
void |
setDataset(MyDataset data)
Function to set the dataset.
|
void |
setMissing(int index)
Function to set a value as missing.
|
void |
setValue(int index,
double value)
Function to set a value.
|
void |
setWeight(double w)
Function to set the weight.
|
java.lang.String |
toString()
Function to print the itemset.
|
protected MyDataset dataset
protected double[] values
protected double weight
protected static final double MISSING_VALUE
public Itemset(Itemset itemset)
itemset
- The itemset to copy.public Itemset(double w, double[] attributeValues)
w
- The weight.attributeValues
- The values.public int classIndex()
public boolean classIsMissing()
public double getClassValue()
public int numClasses()
public MyAttribute getAttribute(int index)
index
- the attribute's indexpublic void setValue(int index, double value)
index
- The index of the attribute.value
- The value.public double getValue(int index)
index
- the attribute's indexpublic final void setWeight(double w)
w
- The weight.public final double getWeight()
public MyDataset getDataset()
public final void setDataset(MyDataset data)
data
- The dataset.public boolean isMissing(int index)
index
- The index of the attribute to check.public static boolean isMissingValue(double val)
val
- The value to check.public static double getMissingValue()
public void setClassMissing()
public final void setMissing(int index)
index
- The index of the attribute.public java.lang.Object copy()
public java.lang.String toString()
toString
in class java.lang.Object