public class Dataset
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Vector |
attributes
The attributes.
|
protected int |
classIndex
The index of the class attribute.
|
protected InstanceSet |
IS
Keel dataset InstanceSet
|
protected java.util.Vector |
itemsets
The itemsets.
|
protected java.lang.String |
name
The name of the dataset.
|
Constructor and Description |
---|
Dataset(Dataset dataset)
Constructor that copies another dataset.
|
Dataset(Dataset dataset,
int capacity)
Constructor to copy all the attributes of another dataset but the itemsets.
|
Dataset(java.lang.String name,
boolean train)
Function to read the .dat file that contains the information of the dataset.
|
Modifier and Type | Method and Description |
---|---|
void |
addItemset(Itemset itemset)
Function to add one itemset.
|
void |
delete(int index)
Function to remove an itemset at the given position.
|
void |
deleteWithMissing(int attIndex)
Function to remove all the attributes with missing value in the given attribute.
|
java.util.Enumeration |
enumerateAttributes()
Enumerates all the attributes.
|
java.util.Enumeration |
enumerateItemsets()
Enumerates all the itemsets.
|
Attribute |
getAttribute(int index)
Returns the attribute that has the index.
|
Attribute |
getAttribute(java.lang.String name)
Returns the attribute that has the name.
|
Attribute |
getClassAttribute()
Returns class attribute.
|
int |
getClassIndex()
Returns the index of the class attribute.
|
java.lang.String |
getName()
Returns the name of the dataset.
|
Itemset |
itemset(int index)
Returns the itemset at the given position.
|
Itemset |
lastItemset()
Returns the last itemset.
|
int |
numAttributes()
Returns the number of attributes.
|
int |
numClasses()
Returns the number of possible values of the class attribute.
|
int |
numItemsets()
Returns the number of itemsets.
|
void |
sort(int attIndex)
Function to sort the dataset based on an attribute.
|
double |
sumOfWeights()
Function to compute the sum of all the weights of the itemsets.
|
protected java.lang.String name
protected java.util.Vector attributes
protected java.util.Vector itemsets
protected int classIndex
protected InstanceSet IS
public Dataset(java.lang.String name, boolean train)
name
- The reader object where the itemsets are readed.train
- The flag if the file is for trainingpublic Dataset(Dataset dataset)
dataset
- The dataset to be copied.public Dataset(Dataset dataset, int capacity)
dataset
- The dataset to be copied.capacity
- The number of itemsets.public final void addItemset(Itemset itemset)
itemset
- The itemset to add to the dataset.public java.lang.String getName()
public final Attribute getAttribute(int index)
index
- The index of the attribute.public final Attribute getAttribute(java.lang.String name)
name
- The name of the attribute.public final Attribute getClassAttribute()
public final int getClassIndex()
public final int numAttributes()
public final int numClasses()
public final int numItemsets()
public final void delete(int index)
index
- The index of the itemset to be deleted.public final void deleteWithMissing(int attIndex)
attIndex
- The index of the attribute.public java.util.Enumeration enumerateAttributes()
public final java.util.Enumeration enumerateItemsets()
public final Itemset itemset(int index)
index
- The index of the itemset.public final Itemset lastItemset()
public final double sumOfWeights()
public final void sort(int attIndex)
attIndex
- The index of the attribute.