Metrics smse
Bases: Metric
A class for computing the standardized mean squared error (SMSE) metric.
This metric is defined as the mean squared error divided by the variance of the true values (the target data). Because we are dividing by the variance of the true values, this metric is scale-independent and does not depend on the mean of the true values. It allows us to effectively compare models drawn from different datasets with differring scales or means (as long as their variances are at least relatively similar)
Source code in yeastdnnexplorer/ml_models/metrics.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
__init__()
¶
Initialize the SMSE metric.
Source code in yeastdnnexplorer/ml_models/metrics.py
19 20 21 22 23 24 |
|
compute()
¶
Compute the SMSE metric.
Returns:
Type | Description |
---|---|
torch.Tensor
|
The SMSE metric |
Source code in yeastdnnexplorer/ml_models/metrics.py
42 43 44 45 46 47 48 49 50 51 52 |
|
update(y_pred, y_true)
¶
Update the metric with new predictions and true values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
y_pred |
Tensor
|
The predicted y values |
required |
y_true |
Tensor
|
The true y values |
required |
Source code in yeastdnnexplorer/ml_models/metrics.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|