Individual performing classification tasks It is used for binary classification (having two classes). It holds four Predicted/Actual values. During evaluation, chromosome value is compared with the target, and classification matrix (below) is built, used for fitness calculation. More...
#include <Individual.h>


Public Member Functions | |
| ClassificationIndividual () | |
| ClassificationIndividual (const ClassificationIndividual &) | |
| virtual | ~ClassificationIndividual () |
| bool | classify () |
| void | evaluate (const u_short &user_param=0.0, const size_t pop_age=0) |
| ret_type | calculateFitness (const size_t pop_age=0) |
| void | reset () |
| std::string | toString () const |
Public Attributes | |
| double | TP |
| double | FN |
| double | FP |
| double | TN |
| bool | zero_output |
Static Public Attributes | |
| static double | roundingThreshold = 0.5 |
| static double | weightFP = 1 |
| static double | weightFN = 1 |
Individual performing classification tasks It is used for binary classification (having two classes). It holds four Predicted/Actual values. During evaluation, chromosome value is compared with the target, and classification matrix (below) is built, used for fitness calculation.
Predicted
A | Yes | No
c ---+------+-------
t Yes| TP | FN
u ---+------+-------
a No | FP | TN
l
| GEP::ClassificationIndividual::ClassificationIndividual | ( | ) |
Default constructor
| GEP::ClassificationIndividual::ClassificationIndividual | ( | const ClassificationIndividual & | copy | ) |
Copy constructor
| virtual GEP::ClassificationIndividual::~ClassificationIndividual | ( | ) | [inline, virtual] |
Default destructor
| double GEP::ClassificationIndividual::calculateFitness | ( | const size_t | pop_age = 0 |
) | [virtual] |
| bool GEP::ClassificationIndividual::classify | ( | ) |
Classification uses rounding threshold to obtain predicted result (0 or 1) (see evaluate()).
| void GEP::ClassificationIndividual::evaluate | ( | const u_short & | user_param = 0.0, |
|
| const size_t | pop_age = 0 | |||
| ) | [virtual] |
Evaluation uses classify() output which is then compared with actual output passed in user_param (actual).
if (_chromosome.getValue() < roundingThreshold) predicted = 0; else predicted 1; if(actual == 0) { //Positive if(predicted == 1) FP++; else TP++; } else { //Negative if(predicted == 1) TN++; else FN++; }
Reimplemented from GEP::Individual< double, double, u_short >.
| void GEP::ClassificationIndividual::reset | ( | ) | [virtual] |
Resets values used for fitness calculation.
Reimplemented from GEP::Individual< double, double, u_short >.
| std::string GEP::ClassificationIndividual::toString | ( | ) | const [inline, virtual] |
Reimplemented from GEP::Individual< double, double, u_short >.
Number of False Negatives
Number of False Positives
double GEP::ClassificationIndividual::roundingThreshold = 0.5 [static] |
Used for real - valued binary classification
Number of True Negatives
Number of True Positives
double GEP::ClassificationIndividual::weightFN = 1 [static] |
double GEP::ClassificationIndividual::weightFP = 1 [static] |
Used for biasing the sensitivity of the classifier
Adjustment to find classifiers making zero of all given data samples
1.6.1