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
|
int[] |
copiaC()
It returns a copy of the values for the output (class)
|
java.lang.String |
copiaCabeceraTest()
It returns a string with the file header
|
Dataset |
copiaDataSet()
Returns a copy of the Dataset read.
|
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)
|
int[] |
getCambio()
Returns the initial values of the original dataset before making any change.
|
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 |
getnclases()
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
|
int[][] |
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)
This function checks if the attribute value is missing
|
void |
leeConjunto(java.lang.String nfejemplos,
boolean train)
It reads the examples file (training or test)
|
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]
|
int[] |
ordenLexicografico()
Sorts the datasets following lexical order.
|
int[] |
tiposVar()
It returns the types of each input (NOMINAL[0] or NUMERIC[1])
|
public Dataset copiaDataSet()
public int[][] getX()
public int[] getC()
public int[] copiaC()
public double[] getemaximo()
public double[] geteminimo()
public int getndatos()
public int getnvariables()
public int getnentradas()
public int getnclases()
public boolean isMissing(int i, int j)
i
- int Example idj
- int Variable idpublic void leeConjunto(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 java.lang.String[] dameNombres()
public java.lang.String[] dameClases()
public boolean hayAtributosContinuos()
public int[] ordenLexicografico()
public int[] getCambio()