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(int nPartition)
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
|
int[][] |
getFakeTransactions()
Outputs an array of transactions with their recasted attribute values.
|
java.util.ArrayList<java.lang.Integer> |
getIDsOfAllAttributeValues()
It returns suitable recasted IDs to recognize later each value belonging to an attribute
|
double |
getMax(int variable)
It returns the upper bound of the variable
<(p>
|
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 |
getnOutput()
It gets the number of output variables
|
int |
getnTrans()
It gets the size of the data-set
|
int |
getNValOutput()
It gets the number of values for the target variable
|
int |
getnVars()
It gets the number of variables of the data-set
|
double[] |
getSteps()
It returns an array with the step values of each attribute depending on the chosen number of partitions
|
java.util.Hashtable<java.lang.Integer,java.util.HashSet<java.lang.Integer>> |
getTIDList()
It outputs an array of attribute values with their corresponding TIDs
|
double[][] |
getTrueTransactions()
Outputs an array of transactions with their corresponding attribute values.
|
double |
getValTrueTransactions(int i,
int j)
Outputs an array of transactions with their corresponding attribute values.
|
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
|
java.lang.String |
header()
It returns the header.
|
boolean |
isMissing(int i,
int j)
This function checks if the attribute value is missing
|
void |
readDataSet(java.lang.String datasetFile,
boolean _isTrain)
It reads the whole input data-set and it stores each transaction in
local array
|
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 myDataset(int nPartition)
Initialize a new set of instances
nPartition
- The number of partition in which numeric attributes are uniformly dividedpublic java.lang.String header()
public double[][] getTrueTransactions()
Outputs an array of transactions with their corresponding attribute values.
public double getValTrueTransactions(int i, int j)
Outputs an array of transactions with their corresponding attribute values.
i
- Position of the examplej
- Positoin of the variablepublic int[][] getFakeTransactions()
Outputs an array of transactions with their recasted attribute values.
public double[] getemax()
It returns an array with the maximum values of the attributes
public double[] getemin()
It returns an array with the minimum values of the attributes
public double getMax(int variable)
It returns the upper bound of the variable <(p>
variable
- Id otf the attributepublic double getMin(int variable)
It returns the lower bound of the variable
variable
- Id of the attributepublic int getnTrans()
It gets the size of the data-set
public int getnVars()
It gets the number of variables of the data-set
public int getNValOutput()
It gets the number of values for the target variable
public int getnOutput()
It gets the number of output variables
public boolean isMissing(int i, int j)
This function checks if the attribute value is missing
i
- int Example idj
- int Variable idpublic void readDataSet(java.lang.String datasetFile, boolean _isTrain) throws java.io.IOException
It reads the whole input data-set and it stores each transaction in local array
datasetFile
- String name of the file containing the data-set_isTrain
- is a flag that indicate if the database is for a train or for a test.java.io.IOException
- If there occurs any problem with the reading of the data-setpublic boolean hasRealAttributes()
It checks if the data-set has any real value
public boolean hasNumericalAttributes()
It checks if the data-set has any numerical value (real or integer)
public boolean hasMissingAttributes()
It checks if the data-set has any missing value
public int sizeWithoutMissing()
It return the size of the data-set without having account the missing values
public boolean[] getMissing(int pos)
It returns an array indicating the position of the missing values on a specific example
pos
- int Id of the examplepublic java.util.ArrayList<java.lang.Integer> getIDsOfAllAttributeValues()
It returns suitable recasted IDs to recognize later each value belonging to an attribute
public double[] getSteps()
It returns an array with the step values of each attribute depending on the chosen number of partitions
public java.util.Hashtable<java.lang.Integer,java.util.HashSet<java.lang.Integer>> getTIDList()
It outputs an array of attribute values with their corresponding TIDs
public java.lang.String getAttributeName(int id_attr)
It returns the name of the attribute in "id_attr"
id_attr
- int Id of the attributepublic int getAttributeType(int id_attr)
It returns the type of the attribute in "id_attr"
id_attr
- int Id of the attributepublic java.lang.String getNominalValue(int id_attr, int id_val)
It returns the nominal value "id_val" within the attribute "id_attr"
id_attr
- int Id of the attributeid_val
- int Id of the nominal value within the attribute