chemometrics.mcr.constraint.Normalizer¶
- class chemometrics.mcr.constraint.Normalizer(axis=- 1, fix=None, copy=False)¶
Bases:
chemometrics.mcr._constraint.Constraint
Normalization constraint.
Normalizes the data along the selected axis. This means, that the transformed vector subsequently sums to one. If the magnitude of the factorized scores and loadings is not set by another constraint, Normalizer is necessary for a well-defined MCR problem.
- Parameters
axis (int) – Which axis of input matrix A to apply normalization across.
fix (list) – Keep fix-axes as-is and normalize the remaining axes based on the residual of the fixed axes.
set_zeros_to_feature (int) –
- Set all samples which sum-to-zero across axis to 1 for a particular
feature (See Notes)
copy (bool) – Make copy of input data, A; otherwise, overwrite (if mutable)
Notes
- For set_zeros_to_feature, assuming the data represents concentration
with a matrix [n_samples, n_features] and the axis is across the features, for every sample that sums to 0 across axis, would be replaced with a vector [n_features] of zeros except at set_zeros_to_feature, which would equal 1. I.e., this pixel is now pure substance of index value set_zeros_to_feature.
- __init__(axis=- 1, fix=None, copy=False)¶
Normalize along axis
Methods
__init__
([axis, fix, copy])Normalize along axis
transform
(A)Apply normalization constraint
- transform(A)¶
Apply normalization constraint