public class ConjuntoDatos
extends java.lang.Object
Title: ConjuntoDatos (Dataset)
Description: Dataset class represents the dataset read from data files and is used by the PSO-ACO algorithm.
Constructor and Description |
---|
ConjuntoDatos()
Default constructor.
|
ConjuntoDatos(java.util.Vector datos)
Parameter constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cubreMinimo(Regla hormiga,
int minimoCasosRegla)
Checks if the rule covers the minimum examples to be considered.
|
void |
eliminaMuestra(int indice)
Removes an example with the given position.
|
boolean |
eliminaMuestra(Muestra muestra)
Removes the given example from the dataset.
|
void |
eliminaMuestrasClase(Regla regla)
Removes from the set the covered cases which have the same class as the rule given.
|
void |
eliminaMuestrasCubiertas(Regla regla)
Removes from dataset the covered cases by the given rule.
|
void |
imprimir(java.lang.String nombre)
Prints the dataset on the standard output.
|
void |
insertaMuestra(Muestra ejemplo)
Adds the given example to the dataset.
|
float[] |
listaProbabilidadesAtributoClase(Atributo atributo,
java.util.Vector clases)
Returns the probabilities vector related to examples with the pair attribute-value and the list of existing classes given.
|
int |
numeroMuestrasCondiciones(Regla hormiga,
java.util.Vector cVacias)
Returns the number of examples covered by the conditions stored
in the rule given.
|
int |
numeroMuestrasCubiertas(Regla hormiga,
java.util.Vector cVacias)
Returns the number of examples covered by the whole rule given
(covered by the conditions and with the same class of the rule).
|
int |
numeroMuestrasCubiertasSinClase(Regla hormiga)
Returns the number of examples covered by the whole rule given
(covered by the conditions and without the same class of the rule).
|
int |
obtenerMayorClase(java.util.Vector listaClases)
Returns the majority class of the dataset (most frequent class).
|
Muestra |
obtenerMuestra()
Returns the first example of the dataset.
|
Muestra |
obtenerMuestra(int indice)
Returns the example in the position given.
|
java.util.Vector |
obtenerMuestras()
Returns all the examples in the dataset.
|
float |
porcentajeMuestrasClase(Atributo clase)
Returns the percentage of examples with the given class.
|
int[] |
porcentajeMuestrasClase(java.util.Vector clases)
Returns the percentage of examples for each class.
|
float |
porcentajeMuestrasCondicion(Condicion condicion,
Atributo clase)
Returns the percentage of examples with the given class covered by the given condition.
|
float |
porcentajeMuestrasCubiertas(Regla regla,
java.util.Vector cVacias)
Computes the percentage of examples of the dataset covered by the given rule.
|
float |
porcentajeMuestrasVacias(Atributo vacio,
Atributo clase)
Returns the percentage of examples with the given class and the attribute as null.
|
int |
tamanio()
Returns the number of examples in the dataset.
|
public ConjuntoDatos()
public ConjuntoDatos(java.util.Vector datos)
datos
- Vector with the examples to include in the dataset built.public void insertaMuestra(Muestra ejemplo)
ejemplo
- given example to be added.public void eliminaMuestra(int indice)
indice
- int position of the example to be removed.public boolean eliminaMuestra(Muestra muestra)
muestra
- Muestra
given example to be removed.public Muestra obtenerMuestra()
Muestra
the first example of the dataset.public Muestra obtenerMuestra(int indice)
indice
- int given position of the example asked.Muestra
the example in the position given.public void imprimir(java.lang.String nombre)
nombre
- String Name of the dataset.public int tamanio()
public float[] listaProbabilidadesAtributoClase(Atributo atributo, java.util.Vector clases)
atributo
- Atributo
pair attribute and value.clases
- Vector of existing classes.public void eliminaMuestrasCubiertas(Regla regla)
regla
- Regla
given rule that cover the different cases to be removed.public void eliminaMuestrasClase(Regla regla)
regla
- Regla
given rule.public float porcentajeMuestrasCubiertas(Regla regla, java.util.Vector cVacias)
regla
- Regla
given rule to check with.cVacias
- Empty/Null conditions of the rule.public java.util.Vector obtenerMuestras()
Muestra
in the dataset.public int obtenerMayorClase(java.util.Vector listaClases)
listaClases
- Vector of existing classes.public float porcentajeMuestrasCondicion(Condicion condicion, Atributo clase)
condicion
- Given condition to check.clase
- Given class.public float porcentajeMuestrasVacias(Atributo vacio, Atributo clase)
vacio
- Given condition to check.clase
- Given class.public float porcentajeMuestrasClase(Atributo clase)
clase
- Given class.public int[] porcentajeMuestrasClase(java.util.Vector clases)
clases
- Vector of existing classes.public int numeroMuestrasCondiciones(Regla hormiga, java.util.Vector cVacias)
hormiga
- Rule given.cVacias
- Empty/Null conditions vector.public int numeroMuestrasCubiertas(Regla hormiga, java.util.Vector cVacias)
hormiga
- Rule given.cVacias
- Empty/Null conditions vector.public int numeroMuestrasCubiertasSinClase(Regla hormiga)
hormiga
- Rule given.public boolean cubreMinimo(Regla hormiga, int minimoCasosRegla)
hormiga
- Rule to be check.minimoCasosRegla
- Minimum number of covered example.