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()
Builder.
|
Modifier and Type | Method and Description |
---|---|
void |
calculaMasComunes()
It computes the most common values for each attribute
|
java.lang.String |
copiaCabeceraTest()
It returns a string with the file header
|
java.lang.String[] |
dameClases()
It return the class values
|
java.lang.String[] |
dameNombres()
It returns the name of the variables of the problem
|
int[] |
getC()
It returns the values for the output (class)
|
double[] |
getemaximo()
It returns an array with the maximum values of the input attributes
|
double[] |
geteminimo()
It returns an array with the minimum values of the input attributes
|
int |
getnClasses()
It returns the total number of classes
|
int |
getndatos()
It returns the number of examples
|
int |
getnentradas()
It returns the number of input variables
|
int |
getnvariables()
It returns the number of variables
|
double[][] |
getX()
It returns the values of the input attributes
|
boolean |
hayAtributosContinuos()
It checks if in the data-set there is any continous input
|
boolean |
isMissing(int i,
int j)
Comprueba si un atributo está "perdido" o no
|
int |
masComun(int i)
It return the most common value for the i-th atribute
|
void |
normaliza()
It converts all values of the data-set to the interval [0,1]
|
void |
readSet(java.lang.String nfejemplos,
boolean train)
It reads the examples file (training or test)
|
int[] |
tiposVar()
It returns the types of each input (NOMINAL[0] or NUMERICAL[1])
|
public double[][] getX()
public int[] getC()
public double[] getemaximo()
public double[] geteminimo()
public int getndatos()
public int getnvariables()
public int getnentradas()
public int getnClasses()
public boolean isMissing(int i, int j)
i
- int Número de ejemploj
- int Número de atributopublic void readSet(java.lang.String nfejemplos, boolean train) throws java.io.IOException
nfejemplos
- String Name of the exampes filetrain
- boolean True if it refers to the training set. False if it is testjava.io.IOException
- A possible I/O exceptionpublic java.lang.String copiaCabeceraTest()
public void normaliza()
public int[] tiposVar()
public void calculaMasComunes()
public int masComun(int i)
i
- int Attribute idpublic boolean hayAtributosContinuos()
public java.lang.String[] dameNombres()
public java.lang.String[] dameClases()