metrics module¶
- class metrics.AccuracyMetrics¶
Bases:
metrics.Metrics
Accuracy metrics class.
- name¶
The name of the metric.
- Type
str
- __init__()¶
Constuctor.
- compute(y, scores)¶
Computes the accuracy of inferred numerical labels when compared to their true counterparts.
- compute(y, scores)¶
Computes the accuracy of inferred numerical labels when compared to their true counterparts.
- Parameters
y (numpy.ndarray) – True labels. Shape is (number of data points, )
scores (numpy.ndarray) – Activation of last layer of the model - the scores of the network. Shape is (batch_size, out_dim) where out_dim is the output dimension of the last layer of the model - usually same as the number of classes.
- Returns
The accuracy of inferred numerical labels when compared to their true counterparts.
- Return type
float
Notes
None
- Raises
AssertionError – If y.shape is not the same as y_hat.shape
- class metrics.MeanSquaredErrorMetrics¶
Bases:
metrics.Metrics
MSE metrics class.
- name¶
The name of the metric.
- Type
str
- __init__()¶
Constuctor.
- compute(y, scores)¶
Computes the MSE of inferred numerical labels when compared to their true counterparts.
- compute(y, scores)¶
Computes the MSE of inferred numerical labels when compared to their true counterparts.
- Parameters
y (numpy.ndarray) – True labels. Shape is (number of data points, )
scores (numpy.ndarray) – Activation of last layer of the model - the scores of the network. Shape is (batch_size, out_dim) where out_dim is the output dimension of the last layer of the model - usually same as the number of classes.
- Returns
The accuracy of inferred numerical labels when compared to their true counterparts.
- Return type
float
Notes
None
- Raises
AssertionError – If y.shape is not the same as y_hat.shape