public class Score
extends java.lang.Object
Constructor and Description |
---|
Score()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addKey(double key)
Adds a new value to the vector.
|
void |
addKey(double key,
int sign)
Adds a new value to the vector.
|
void |
addNegative(double key)
Increases the number of negatives instances of a given values.
|
void |
addNegative(int pos)
Increases the number of negatives instances in a given vector's position.
|
void |
addPositive(double key)
Increases the number of positives instances of a given values.
|
void |
addPositive(int pos)
Increases the number of positives instances in a given vector's position.
|
int |
findKey(double key)
Returns the vector's position of a given value
|
double |
getKey(int pos)
Returns the value at a given position of the vector
(inverse method of findKey).
|
int |
getNegative(double key)
Returns the number of negative instances that contains the given value.
|
int |
getNegative(int pos)
Returns the number of negative instances of the dataset
that contains the value at a given position of the vector.
|
int |
getPositive(double key)
Returns the number of positive instances that contains the given value.
|
int |
getPositive(int pos)
Returns the number of positive instances of the dataset
that contains the value at a given position of the vector.
|
int |
getTotal(double key)
Returns the total number of instances that contains the given value.
|
int |
getTotal(int pos)
Returns the total number of instances of the dataset
that contains the value at a given position of the vector.
|
int |
size()
Returns the size of the vector (the number of values).
|
void |
sort()
Sorts the trios stored with the mergesort algorithm.
|
java.lang.String |
toString()
Returns a string representation of this Score, containing the String representation of each Trio.
|
java.lang.String |
toString(int a)
Returns a string representation of this Score, containing the String representation of each Trio, taking into account the given attribute's id.
|
public void addKey(double key)
key
- double the new valuepublic void addKey(double key, int sign)
key
- double the new valuesign
- int it indicates wich of the measures will be intialized to 1 (the other will be initialized to 0)public void addPositive(int pos)
pos
- int vector's positionpublic void addPositive(double key)
key
- double the valuepublic void addNegative(int pos)
pos
- int vector's positionpublic void addNegative(double key)
key
- double the valuepublic int findKey(double key)
key
- double the valuepublic double getKey(int pos)
pos
- int position of the vector.public int getPositive(int pos)
pos
- int position of the vectorpublic int getPositive(double key)
key
- double the valuepublic int getNegative(int pos)
pos
- int position of the vectorpublic int getNegative(double key)
key
- double the valuepublic int getTotal(int pos)
pos
- int position of the vectorpublic int getTotal(double key)
key
- double the valuepublic void sort()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int a)
a
- int attribute's id