public class Dataset
extends java.lang.Object
Title: Data-set
Description: It contains the methods for reading the training and test files
Constructor and Description |
---|
Dataset()
Constructor, creates a new set of instances
|
Modifier and Type | Method and Description |
---|---|
void |
calculaMasComunes()
Calculate the values most commons for each column or attribute
|
java.lang.String |
copiaCabeceraTest()
Returns a string with the header of the file
|
int[][][] |
creaCount()
Creates a matrix training set, stored for each class, each attribute, and each value
the number of examples of class C that have value V for the attribute A COUNT[C,V,A]
|
java.lang.String[] |
dameClases()
Returns teh value of the classes
|
java.lang.String[] |
dameNombres()
Returns the name of the problem's variables
|
java.lang.String |
findNominalValue(int atr,
double valor)
Returns the nominal value of the double value of the attribute
|
int[] |
getC()
Returns the values for the out-put(class)
|
java.lang.String[] |
getC2()
Returns the values for the out-put(class)
|
int[][] |
getClaseOptima(int[][][] Count,
long seed)
Returns a vector with the optimum class for each pair attribute-value
|
double[] |
getemaximo()
Returns an array with the maximum values of the in-put attributes
|
double[] |
geteminimo()
Returns an array with the minimum values of the in-put values
|
InstanceSet |
getInstanceSet()
Returns the instance set
|
double[][] |
getListValues()
Gets for each attribute the sorted list of its possible values
|
int |
getMaximo(double[] num,
long seed)
Returns the index where is the maximum in an array of doubles
|
int |
getnclases()
Returns the total number of classes
|
int |
getndatos()
Return the number of examples
|
int |
getnentradas()
Return the number of input variables
|
int[] |
getNumValues()
Returns for each attribute the number of different values
|
int[] |
getNumValues2()
Returns for each attribute the number of different values
|
int |
getnvariables()
Returns the number of variables
|
double[][] |
getX()
It returns the values of the input attributes
|
double[] |
getX(int pos)
Return the values of the in-put attributes for an instance
|
java.lang.String[][] |
getX2()
Return the values of the in-put attributes
|
boolean |
hayAtributosContinuos()
Checks if in the data base there is a in-put type real or continous
|
boolean |
hayInstanciasDeClaseC(int whichClass)
Checks if in the instances set left instances of a determined class
|
boolean |
isMissing(int i,
int j)
Checks if one attribute is missing or not
|
void |
leeConjunto(java.lang.String nfejemplos,
boolean train)
Reads the file of examples(Train&Test)
|
int |
masComun(int i)
Return the value most common of the attribute 'i'
|
void |
normaliza()
Convert all the values of the set of values in the inetrval[0,1]
|
int[] |
tiposVar()
Return the types of each in-put(NOMINAL[0] o NUMERIC[1])
|
public double[][] getX()
public java.lang.String[][] getX2()
Return the values of the in-put attributes
public double[] getX(int pos)
Return the values of the in-put attributes for an instance
pos
- The position of the instance in the set of valuespublic InstanceSet getInstanceSet()
public java.lang.String findNominalValue(int atr, double valor)
Returns the nominal value of the double value of the attribute
atr
- attribute id.valor
- attribute id.public boolean hayInstanciasDeClaseC(int whichClass) throws java.lang.ArrayIndexOutOfBoundsException
Checks if in the instances set left instances of a determined class
whichClass
- The classjava.lang.ArrayIndexOutOfBoundsException
public double[][] getListValues()
Gets for each attribute the sorted list of its possible values
public int[][][] creaCount()
Creates a matrix training set, stored for each class, each attribute, and each value the number of examples of class C that have value V for the attribute A COUNT[C,V,A]
public int[][] getClaseOptima(int[][][] Count, long seed)
Returns a vector with the optimum class for each pair attribute-value
Count
- each pair attribute-valueseed
- seed.public int getMaximo(double[] num, long seed)
Returns the index where is the maximum in an array of doubles
num
- array of doubles given.seed
- seedpublic int[] getNumValues()
Returns for each attribute the number of different values
public int[] getNumValues2()
Returns for each attribute the number of different values
public int[] getC()
Returns the values for the out-put(class)
public java.lang.String[] getC2()
Returns the values for the out-put(class)
public double[] getemaximo()
Returns an array with the maximum values of the in-put attributes
public double[] geteminimo()
Returns an array with the minimum values of the in-put values
public int getndatos()
Return the number of examples
public int getnvariables()
Returns the number of variables
public int getnentradas()
Return the number of input variables
public int getnclases()
Returns the total number of classes
public boolean isMissing(int i, int j)
Checks if one attribute is missing or not
i
- int Number of examplej
- int Number of attribuepublic void leeConjunto(java.lang.String nfejemplos, boolean train) throws java.io.IOException
Reads the file of examples(Train&Test)
nfejemplos
- String Nom of the examples filetrain
- boolean True if Train set. False is test set.java.io.IOException
- A possible I/O errorpublic java.lang.String copiaCabeceraTest()
Returns a string with the header of the file
public void normaliza()
Convert all the values of the set of values in the inetrval[0,1]
public int[] tiposVar()
Return the types of each in-put(NOMINAL[0] o NUMERIC[1])
public void calculaMasComunes()
Calculate the values most commons for each column or attribute
public int masComun(int i)
Return the value most common of the attribute 'i'
i
- int Number of the attributepublic java.lang.String[] dameNombres()
Returns the name of the problem's variables
public java.lang.String[] dameClases()
Returns teh value of the classes
public boolean hayAtributosContinuos()
Checks if in the data base there is a in-put type real or continous