apca.metrics¶
Provided metrics for evaluating AugmentedPCA models.
Reconstruction Error¶
-
apca.metrics.
reconstruct_error
(a: numpy.ndarray, a_recon: numpy.ndarray, reduction: str = 'mean') → numpy.ndarray¶ Computes the reconstruction error between two matrices. This function can be used to determine the reconstruction error between original data matrices (primary or augmenting) and data matrices reconstructed via APCA.
- Parameters
- anumpy.ndarray
Original data matrix.
- a_reconnumpy.ndarray
Reconstructed data matrix.
- reductionstr; optional, default is ‘mean’
Specifies the reduction to apply to the output: ‘mean’ or ‘sum’. ‘mean’: mean of the squared error is taken, ‘sum’: sum of the squared error is taken.
- Returns
- errfloat
Reconstruction error between a and a_recon.