runn.metrics
Useful metrics for evaluating the performance of the neural network models.
AMPCA(proba, y)
#
Arithmetic Mean Probability of Correct Assignment (AMPCA) metric.
PARAMETER | DESCRIPTION |
---|---|
proba |
Matrix of predicted choice probabilities. Each row corresponds to a sample and each column to an
TYPE:
|
y |
Array of true choices. Each element corresponds to the index of the chosen alternative.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
AMPCA metric. |
Source code in runn/metrics.py
CEL(proba, y)
#
Cross-Entropy Loss (CEL) metric.
PARAMETER | DESCRIPTION |
---|---|
proba |
Matrix of predicted choice probabilities. Each row corresponds to a sample and each column to an
TYPE:
|
y |
Array of true choices. Each element corresponds to the index of the chosen alternative.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
CEL metric. |
Source code in runn/metrics.py
GMPCA(proba, y)
#
Geometric Mean Probability of Correct Assignment (GMPCA) metric.
PARAMETER | DESCRIPTION |
---|---|
proba |
Matrix of predicted choice probabilities. Each row corresponds to a sample and each column to an
TYPE:
|
y |
Array of true choices. Each element corresponds to the index of the chosen alternative.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
GMPCA metric. |
Source code in runn/metrics.py
accuracy(proba, y)
#
Accuracy metric.
PARAMETER | DESCRIPTION |
---|---|
proba |
Matrix of predicted choice probabilities. Each row corresponds to a sample and each column to an
TYPE:
|
y |
Array of true choices. Each element corresponds to the index of the chosen alternative.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
Accuracy metric. |