chemometrics.mcr.McrAR¶
Multivariate Curve Resolution - Alternating Regression
Multivariate curve resolution factorizes data such that the factors
maximize the explained data. Additional constraints are given for the
scores and loadings, such as non-negativeness, baseline restrictions,
unimodality, etc. Due to its origin in the analysis of chemical
information, a different nomenclature is widely used in literature and also
in this implementation. Scores are interpreted as concentration matrices
C_
, loadings are the transposed spectral matrices ST_
.
- param c_regr
Instantiated regression class (or string, see Notes) for calculating the C matrix
- type c_regr
str, class
- param st_regr
Instantiated regression class (or string, see Notes) for calculating the S^T matrix
- type st_regr
str, class
- param fit_kwargs
kwargs sent to fit and fit_transform methods
- type fit_kwargs
dict
- param c_fit_kwargs
kwargs sent to c_regr.fit method
- type c_fit_kwargs
dict
- param st_fit_kwargs
kwargs sent to``st_regr.fit`` method
- type st_fit_kwargs
dict
- param c_constraints
List of constraints applied to calculation of C matrix
- type c_constraints
list
- param st_constraints
List of constraints applied to calculation of S^T matrix
- type st_constraints
list
- param max_iter
Maximum number of iterations. One iteration calculates both C and S^T
- type max_iter
int
- param err_fcn
Function to calculate error/differences after each least squares calculation (ie twice per iteration). Outputs to err attribute.
- type err_fcn
function
- param tol_increase
Factor increase to allow in err attribute. Set to 0 for no increase allowed. E.g., setting to 1.0 means the err can double per iteration.
- type tol_increase
float
- param tol_n_increase
Number of consecutive iterations for which the err attribute can increase
- type tol_n_increase
int
- param tol_err_change
If err changes less than tol_err_change, per iteration, break.
- type tol_err_change
float
- param tol_n_above_min
Number of half-iterations that can be performed without reaching a new error-minimum
- type tol_n_above_min
int
- chemometrics.mcr.McrAR.err¶
List of calculated errors (from err_fcn) after each least squares (ie twice per iteration)
- Type
list
- chemometrics.mcr.McrAR.C_¶
Most recently calculated C matrix (that did not cause a tolerance failure)
- Type
ndarray [n_samples, n_targets]
- chemometrics.mcr.McrAR.ST_¶
Most recently calculated S^T matrix (that did not cause a tolerance failure)
- Type
ndarray [n_targets, n_features]
- chemometrics.mcr.McrAR.components_¶
Synonym for
ST_
, providing sklearn like compatibility- Type
ndarray [n_targets, n_features]
- chemometrics.mcr.McrAR.C_opt_¶
[Optimal] C matrix for lowest err attribute
- Type
ndarray [n_samples, n_targets]
- chemometrics.mcr.McrAR.ST_opt_¶
[Optimal] ST matrix for lowest err attribute
- Type
ndarray [n_targets, n_features]
- chemometrics.mcr.McrAR.n_iter¶
Total number of iterations performed
- Type
int
- chemometrics.mcr.McrAR.n_features¶
Total number of features, e.g. spectral frequencies.
- Type
int
- chemometrics.mcr.McrAR.n_samples¶
Total number of samples (e.g., pixels)
- Type
int
- chemometrics.mcr.McrAR.n_targets¶
Total number of targets (e.g., pure analytes)
- Type
int
- chemometrics.mcr.McrAR.n_iter_opt¶
Iteration when optimal C and ST calculated
- Type
int
- chemometrics.mcr.McrAR.exit_max_iter_reached¶
Exited iterations due to maximum number of iteration reached (max_iter parameter)
- Type
bool
- chemometrics.mcr.McrAR.exit_tol_increase¶
Exited iterations due to maximum fractional increase in error metric (via err_fcn)
- Type
bool
- chemometrics.mcr.McrAR.exit_tol_n_increase¶
Exited iterations due to maximum number of consecutive increases in error metric (via err fcn)
- Type
bool
- chemometrics.mcr.McrAR.exit_tol_err_change¶
Exited iterations due to error metric change that is smaller than tol_err_change
- Type
bool
- chemometrics.mcr.McrAR.exit_tol_n_above_min¶
Exited iterations due to maximum number of half-iterations for which the error metric increased above the minimum error
- Type
bool
Notes
Built-in regressor classes (str can be used): OLS (ordinary least squares), NNLS (non-negatively constrained least squares). See mcr.regressors.
Built-in regressor methods can be given as a string to
c_regr
,st_regr
; though instantiating an imported class gives more flexibility.Setting any tolerance to None turns that check off
Module Attributes
noindex: |
|