public class myDataset
extends java.lang.Object
It contains the methods to read a Dataset for the Association Rules Mining problem
Modifier and Type | Field and Description |
---|---|
static int |
INTEGER
Number to represent type of variable integer.
|
static int |
NOMINAL
Number to represent type of variable nominal.
|
static int |
REAL
Number to represent type of variable real or double.
|
Constructor and Description |
---|
myDataset()
Initialize a new set of instances
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttributeName(int id_attr)
It returns the name of the attribute in "id_attr"
|
int |
getAttributeType(int id_attr)
It returns the type of the attribute in "id_attr"
|
double[] |
getemax()
It returns an array with the maximum values of the attributes
|
double[] |
getemin()
It returns an array with the minimum values of the attributes
|
double[] |
getExample(int pos)
Output a specific example
|
java.util.ArrayList<java.lang.Integer> |
getIDsOfNominalAttributes()
It returns the IDs of the nominal attributes
|
java.util.ArrayList<java.lang.Integer> |
getIDsOfNumericAttributes()
It returns the IDs of the numeric attributes
|
double |
getMax(int variable)
It returns the upper bound of the variable
|
double |
getMin(int variable)
It returns the lower bound of the variable
|
boolean[] |
getMissing(int pos)
It returns an array indicating the position of the missing values on a specific example
|
java.lang.String |
getNominalValue(int id_attr,
int id_val)
It returns the nominal value "id_val" within the attribute "id_attr"
|
int |
getnTrans()
It gets the size of the data-set
|
int |
getnVars()
It gets the number of variables of the data-set
|
java.lang.String |
getRelationName()
It gets the relation name.
|
double[][] |
getTrueTransactions()
Outputs an array of transactions with their corresponding attribute values.
|
int |
getType(int variable)
It returns the type of the attribute specified
|
boolean |
hasMissingAttributes()
It checks if the data-set has any missing value
|
boolean |
hasNumericalAttributes()
It checks if the data-set has any numerical value (real or integer)
|
boolean |
hasRealAttributes()
It checks if the data-set has any real value
|
boolean |
isInteger(int i)
This function checks if the attribute value is integer
|
boolean |
isMissing(int i,
int j)
This function checks if the attribute value is missing
|
boolean |
isNominal(int i)
This function checks if the attribute value is nominal
|
java.lang.String |
nameNominal(int variable,
int value)
Returns the nominal representation of the given value of the given attribute.
|
java.lang.String[] |
names()
It returns the name of the attributes
|
int |
posValueNominal(int variable,
java.lang.String value)
Returns the integer representation (id or position) of the given attribute's value.
|
int |
posVariable(java.lang.String variable)
Returns the id (position) of an attribute with the given name.
|
void |
readDataSet(java.lang.String datasetFile)
It reads the whole input data-set and it stores each transaction in
local array
|
double[][] |
returnRanks()
Returns the minimum and maximum values of every attributes as a matrix.
|
int |
sizeWithoutMissing()
It return the size of the data-set without having account the missing values
|
public static final int NOMINAL
public static final int INTEGER
public static final int REAL
public double[][] getTrueTransactions()
public double[] getemax()
public double[] getemin()
public double[] getExample(int pos)
pos
- int position (id) of the example in the data-setpublic double getMax(int variable)
variable
- Id of the attributepublic double getMin(int variable)
variable
- Id of the attributepublic int getnTrans()
public int getnVars()
public boolean isMissing(int i, int j)
i
- int Example idj
- int Variable idpublic boolean isNominal(int i)
i
- int attribute idpublic boolean isInteger(int i)
i
- int attribute idpublic void readDataSet(java.lang.String datasetFile) throws java.io.IOException
datasetFile
- String name of the file containing the data-setjava.io.IOException
- If there occurs any problem with the reading of the data-setpublic boolean hasRealAttributes()
public boolean hasNumericalAttributes()
public boolean hasMissingAttributes()
public int sizeWithoutMissing()
public boolean[] getMissing(int pos)
pos
- int Id of the examplepublic java.util.ArrayList<java.lang.Integer> getIDsOfNumericAttributes()
public java.util.ArrayList<java.lang.Integer> getIDsOfNominalAttributes()
public java.lang.String getAttributeName(int id_attr)
id_attr
- int Id of the attributepublic int getAttributeType(int id_attr)
id_attr
- int Id of the attributepublic java.lang.String getRelationName()
public java.lang.String getNominalValue(int id_attr, int id_val)
id_attr
- int Id of the attributeid_val
- int Id of the nominal value within the attributepublic int getType(int variable)
variable
- index of the attributepublic double[][] returnRanks()
public java.lang.String[] names()
public java.lang.String nameNominal(int variable, int value)
variable
- attribute's id.value
- value asked.public int posVariable(java.lang.String variable)
variable
- given attribute's name.public int posValueNominal(int variable, java.lang.String value)
variable
- attribute's id.value
- value asked.