public class Dataset
extends java.lang.Object
Class to manage data sets
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
|
java.lang.String[] |
dameClases()
Returns teh value of the classes
|
java.lang.String[] |
dameNombres()
Returns the name of the problem's variables
|
int[] |
getC()
Returns the values for the out-put(class)
|
java.lang.String[] |
getC2()
Returns the string values for the out-put(class)
|
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 instances set.
|
int |
getnclases()
Returns the total number of classes
|
int |
getndatos()
Return the number of examples
|
int |
getnentradas()
Return the number of in-put variables
|
int |
getnvariables()
Returns the number of variables
|
double[][] |
getX()
Return the values of the in-put attributes
|
double[] |
getX(int pos)
Return the values of the in-put attributes for an instance
|
java.lang.String[][] |
getX2()
Return the string values of the in-put attributes
|
boolean |
hayAtributosContinuos()
Checks if in the data base there is a in-put type real or continous
|
boolean |
hayAtributosDiscretos()
Checks if in the data base there is an in-put type integer
|
boolean |
hayInstanciasDeClaseC(int whichClass)
Checks if in the instance set the are instances of a one determinet class
|
boolean |
isMissing(int i,
int j)
Checks if one attribute is lost 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()
Return the values of the in-put attributes
public java.lang.String[][] getX2()
Return the string 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 boolean hayInstanciasDeClaseC(int whichClass) throws java.lang.ArrayIndexOutOfBoundsException
Checks if in the instance set the are instances of a one determinet class
whichClass
- the classjava.lang.ArrayIndexOutOfBoundsException
public int[] getC()
Returns the values for the out-put(class)
public java.lang.String[] getC2()
Returns the string 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 in-put variables
public int getnclases()
Returns the total number of classes
public boolean isMissing(int i, int j)
Checks if one attribute is lost 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
public boolean hayAtributosDiscretos()
Checks if in the data base there is an in-put type integer