spectrochempy.IRISο
- class IRIS(log_level='WARNING', warm_start=False, *, qpsolver='osqp', reg_par=None)[source]ο
- Integral inversion solver for spectroscopic data (IRIS). - IRIS, a model developed by Stelmachowski et al. [2013], solves integral equation of the first kind of 1 or 2 dimensions, i.e., finds a distribution function \(f(p)\) or \(f(c,p)\) of contributions to univariate data \(a(p)\) or multivariate \(a(c, p)\) data evolving with an external experimental variable \(p\) (time, pressure, temperature, concentration, β¦) according to the integral transform:\[a(c, p) = \int_{min}^{max} k(q, p) f(c, q) dq\]\[a(p) = \int_{min}^{max} k(q, p) f(q) dq\]- where the kernel \(k(q, p)\) expresses the functional dependence of a single contribution with respect to the experimental variable \(p\) and βinternalβ physico-chemical variable \(q\) . - Regularization is triggered when - reg_paris set to an array of two or three values.- If - reg_parhas two values [- min,- max], the optimum regularization parameter is searched between \(10^{min}\) and \(10^{max}\). Automatic search of the regularization is made using the Cultrera_Callegaro algorithm (:cite:p:cultrera:2020) which involves the Menger curvature of a circumcircle and the golden section search method.- If three values are given ([ - min,- max,- num]), then the inversion will be made for- numvalues evenly spaced on a log scale between \(10^{min}\) and \(10^{max}\).- Parameters:
- log_level (any of [ - "INFO",- "DEBUG",- "WARNING",- "ERROR"], optional, default:- "WARNING") β The log level at startup. It can be changed later on using the- set_log_levelmethod or by changing the- log_levelattribute.
- warm_start ( - bool, optional, default:- False) β When fitting repeatedly on the same dataset, but for multiple parameter values (such as to find the value maximizing performance), it may be possible to reuse previous model learned from the previous parameter value, saving time.- When - warm_startis- True, the existing fitted model attributes is used to initialize the new model in a subsequent call to- fit.
- qpsolver (any value of [ - 'osqp',- 'quadprog'], optional, default:- 'osqp') β Quatratic programming solver (- osqp(default) or- quadprog). Note that quadprog is not installed with spectrochempy.
- reg_par ( - list, optional, default: []) β Regularization parameter (two values [- min,- max] or three values [- start,- stop,- num]. If- reg_paris None, no regularization is applied.
 
 - See also - EFA
- Perform an Evolving Factor Analysis (forward and reverse). 
- FastICA
- Perform Independent Component Analysis with a fast algorithm. 
- MCRALS
- Perform MCR-ALS of a dataset knowing the initial \(C\) or \(S^T\) matrix. 
- NMF
- Non-Negative Matrix Factorization. 
- PCA
- Perform Principal Components Analysis. 
- SIMPLISMA
- SIMPLe to use Interactive Self-modeling Mixture Analysis. 
- SVD
- Perform a Singular Value Decomposition. 
 - Initialize the BaseConfigurable class. - Parameters:
- log_level (int, optional) β The log level at startup. Default is logging.WARNING. 
- **kwargs (dict) β Additional keyword arguments for configuration. 
 
 - Attributes Summary - Return the X input dataset (eventually modified by the model). - The - Yinput.- NDDatasetwith components in feature space (n_components, n_features).- traitlets.config.Configobject.- Return - logoutput.- Number of components that were fitted. - Object name - Quatratic programming solver ( - osqp(default) or- quadprog).- Regularization parameter (two values [ - min,- max] or three values [- start,- stop,- num].- Methods Summary - fit(X[,Β Y])- Fit the model with - Xas input dataset.- fit_transform(X[,Β Y])- Fit the model with - Xand apply the dimensionality reduction on- X.- get_components([n_components])- Return the component's dataset: (selected n_components, n_features). - Transform data back to the original space. - parameters([replace,Β removed,Β default])- Alias for - paramsmethod.- params([default])- Return current or default configuration values. - plotdistribution([index])- Plot the distribution function. - plotlcurve([scale,Β title])- Plot the - L-Curve.- plotmerit([index])- Plot the input dataset, reconstructed dataset and residuals. - reconstruct([X_transform])- Transform data back to its original space. - reduce([X])- Apply dimensionality reduction to - X.- reset()- Reset configuration parameters to their default values. - to_dict()- Return config value in a dict form. - transform([X])- Apply dimensionality reduction to - X.- Attributes Documentation - Xο
- Return the X input dataset (eventually modified by the model). 
 - componentsο
- NDDatasetwith components in feature space (n_components, n_features).- See also - get_components
- Retrieve only the specified number of components. 
 
 - configο
- traitlets.config.Configobject.
 - logο
- Return - logoutput.
 - n_componentsο
- Number of components that were fitted. 
 - nameο
- Object name 
 - qpsolverο
- Quatratic programming solver ( - osqp(default) or- quadprog). Note that quadprog is not installed with spectrochempy.
 - reg_parο
- Regularization parameter (two values [ - min,- max] or three values [- start,- stop,- num]. If- reg_paris None, no regularization is applied.
 - Methods Documentation - fit(X, Y=None)[source]ο
- Fit the model with - Xas input dataset.- Parameters:
- X ( - NDDatasetor array-like of shape (n_observations, n_features)) β Training data.
- Y (any) β Depends on the model. 
 
- Returns:
- self β The fitted instance itself. 
 - See also - fit_transform
- Fit the model with an input dataset - Xand apply the dimensionality reduction on- X.
- fit_reduce
- Alias of - fit_transform(Deprecated).
 
 - fit_transform(X, Y=None, **kwargs)[source]ο
- Fit the model with - Xand apply the dimensionality reduction on- X.- Parameters:
- X ( - NDDatasetor array-like of shape (n_observations, n_features)) β Training data.
- Y (any) β Depends on the model. 
- **kwargs (keyword parameters, optional) β See Other Parameters. 
 
- Returns:
- NDDatasetβ Dataset with shape (n_observations, n_components).
- Other Parameters:
- n_components ( - int, optional) β The number of components to use for the reduction. If not given the number of components is eventually the one specified or determined in the- fitprocess.
 
 - get_components(n_components=None)ο
- Return the componentβs dataset: (selected n_components, n_features). - Parameters:
- n_components ( - int, optional, default:- None) β The number of components to keep in the output dataset. If- None, all calculated components are returned.
- Returns:
- NDDatasetβ Dataset with shape (n_components, n_features)
 
 - inverse_transform()[source]ο
- Transform data back to the original space. - The following matrix operation is performed : \(\hat{X} = K.f[i]\) for each value of the regularization parameter. - Returns:
- NDDatasetβ The reconstructed dataset.
 
 - parameters(replace="params", removed="0.8.0") def parameters(self, default=False)[source]ο
- Alias for - paramsmethod.- Deprecated since version 0.8.0: Use - paramsinstead.
 - plotdistribution(index=None, **kwargs)[source]ο
- Plot the distribution function. - This function plots the distribution function f of the - IRISobject.
 - plotmerit(index=None, **kwargs)[source]ο
- Plot the input dataset, reconstructed dataset and residuals. - Parameters:
- Returns:
- Other Parameters:
- colors ( - tupleor- ndarrayof 3 colors, optional) β Colors for- X,- X_hatand residuals- E. in the case of 2D, The default colormap is used for- X. By default, the three colors are- NBlue,- NGreenand- NRed(which are colorblind friendly).
- offset ( - float, optional, default:- None) β Specify the separation (in percent) between the \(X\) , \(X_hat\) and \(E\).
- nb_traces ( - intor- 'all', optional) β Number of lines to display. Default is- 'all'.
- **others (Other keywords parameters) β Parameters passed to the internal - plotmethod of the- Xdataset.
 
 
 - reconstruct(X_transform=None, **kwargs)[source]ο
- Transform data back to its original space. - In other words, return an input - X_originalwhose reduce/transform would be- X_transform.- Parameters:
- X_transform (array-like of shape (n_observations, n_components), optional) β Reduced - Xdata, where- n_observationsis the number of observations and- n_componentsis the number of components. If- X_transformis not provided, a transform of- Xprovided in- fitis performed first.
- **kwargs (keyword parameters, optional) β See Other Parameters. 
 
- Returns:
- NDDatasetβ Dataset with shape (n_observations, n_features).
- Other Parameters:
- n_components ( - int, optional) β The number of components to use for the reduction. If not given the number of components is eventually the one specified or determined in the- fitprocess.
 - See also - reconstruct
- Alias of inverse_transform (Deprecated). 
 - Notes - Deprecated in version 0.6. 
 - reduce(X=None, **kwargs)[source]ο
- Apply dimensionality reduction to - X.- Parameters:
- X ( - NDDatasetor array-like of shape (n_observations, n_features), optional) β New data, where n_observations is the number of observations and n_features is the number of features. if not provided, the input dataset of the- fitmethod will be used.
- **kwargs (keyword parameters, optional) β See Other Parameters. 
 
- Returns:
- NDDatasetβ Dataset with shape (n_observations, n_components).
- Other Parameters:
- n_components ( - int, optional) β The number of components to use for the reduction. If not given the number of components is eventually the one specified or determined in the- fitprocess.
 - Notes - Deprecated in version 0.6. 
 - transform(X=None, **kwargs)ο
- Apply dimensionality reduction to - X.- Parameters:
- X ( - NDDatasetor array-like of shape (n_observations, n_features), optional) β New data, where n_observations is the number of observations and n_features is the number of features. if not provided, the input dataset of the- fitmethod will be used.
- **kwargs (keyword parameters, optional) β See Other Parameters. 
 
- Returns:
- NDDatasetβ Dataset with shape (n_observations, n_components).
- Other Parameters:
- n_components ( - int, optional) β The number of components to use for the reduction. If not given the number of components is eventually the one specified or determined in the- fitprocess.
 
 
Examples using spectrochempy.IRIS
