public class DataBase
extends java.lang.Object
Constructor and Description |
---|
DataBase()
Default Constructor
|
DataBase(myDataset train)
Parameters Constructor
|
Modifier and Type | Method and Description |
---|---|
int[] |
getnLabels()
It return the whole array of number of labels for every attribute
|
int |
matching(int variable,
int label,
int value)
It checks if the value of a specific label in a specific attribute matchs with a given value
|
int |
numClasses()
It returns the number of different possible outputs (classes) of the examples
|
int |
numLabels(int variable)
It returns the number of different labels that a specific input attribute can hold
|
int |
numVariables()
It returns the number of input attributes in the examples
|
int |
numVariablesUsed()
It returns the number of input attributes which has been used
|
java.lang.String |
print(int var,
int label)
It prints an attribute with its label in a string way
|
java.lang.String |
printString()
It prints the whole database
|
void |
saveFile(java.lang.String filename)
It stores the data base in a given file
|
public DataBase()
Default Constructor
public DataBase(myDataset train)
Parameters Constructor
train
- It contains the train data set with the whole information to execute the algorithmpublic int numVariables()
It returns the number of input attributes in the examples
public int numVariablesUsed()
It returns the number of input attributes which has been used
public int numClasses()
It returns the number of different possible outputs (classes) of the examples
public int numLabels(int variable)
It returns the number of different labels that a specific input attribute can hold
variable
- The input attribute which we want to know the number of different labels it can havepublic int[] getnLabels()
It return the whole array of number of labels for every attribute
public int matching(int variable, int label, int value)
It checks if the value of a specific label in a specific attribute matchs with a given value
variable
- Attribute which we are going to checklabel
- Attribute's label we are going to checkvalue
- Value to be comparedpublic java.lang.String print(int var, int label)
It prints an attribute with its label in a string way
var
- Attribute to be printedlabel
- Attribute's label to be printedpublic java.lang.String printString()
It prints the whole database
public void saveFile(java.lang.String filename)
It stores the data base in a given file
filename
- Name for the database file