evaluation
ci(gold_truths, predictions)
Computes concordance index (CI) between the expected values and predictions. See Gönen and Heller (2005) for the details of the metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gold_truths |
List[float]
|
The gold labels in the dataset. |
required |
predictions |
List[float]
|
Predictions of a model. |
required |
Returns:
Type | Description |
---|---|
float
|
Concordance index. |
Source code in pydebiaseddta/evaluation.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
evaluate_predictions(gold_truths, predictions, metrics=None)
Computes multiple metrics with a single call for convenience.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gold_truths |
List[float]
|
The gold labels in the dataset. |
required |
predictions |
List[float]
|
Predictions of a model. |
required |
metrics |
List[str]
|
Name of the evaluation metrics to compute. Possible values are: |
None
|
Returns:
Type | Description |
---|---|
Dict[str, float]
|
A dictionary that maps each metric name to the computed value. |
Source code in pydebiaseddta/evaluation.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|
mse(gold_truths, predictions)
Computes mean squared error between expected and predicted values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gold_truths |
List[float]
|
The gold labels in the dataset. |
required |
predictions |
List[float]
|
Predictions of a model. |
required |
Returns:
Type | Description |
---|---|
float
|
Mean squared error. |
Source code in pydebiaseddta/evaluation.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
r2(gold_truths, predictions)
Compute \(R^2\) (coefficient of determinant) between expected and predicted values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gold_truths |
List[float]
|
The gold labels in the dataset. |
required |
predictions |
List[float]
|
Predictions of a model. |
required |
Returns:
Type | Description |
---|---|
float
|
\(R^2\) (coefficient of determinant) score. |
Source code in pydebiaseddta/evaluation.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
rmse(gold_truths, predictions)
Computes root mean squared error between expected and predicted values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gold_truths |
List[float]
|
The gold labels in the dataset. |
required |
predictions |
List[float]
|
Predictions of a model. |
required |
Returns:
Type | Description |
---|---|
float
|
Root mean squared error. |
Source code in pydebiaseddta/evaluation.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|