shnitsel.core.ml ================ .. py:module:: shnitsel.core.ml Functions --------- .. autoapisummary:: shnitsel.core.ml.pca shnitsel.core.ml.lda shnitsel.core.ml.pls shnitsel.core.ml.pls_ds Module Contents --------------- .. py:function:: pca(da, dim, n_components = 2, return_pca_object = False) xarray-oriented wrapper around scikit-learn's PCA :param da: A DataArray with at least a dimension with a name matching `dim` :param dim: The name of the dimension to reduce :param n_components: The number of principle components to return, by default 2 :param optional: The number of principle components to return, by default 2 :param return_pca_object: Whether to return the scikit-learn `PCA` object as well as the transformed data, by default False :param optional: Whether to return the scikit-learn `PCA` object as well as the transformed data, by default False :returns: * *pca_res* -- A DataArray with the same dimensions as `da`, except for the dimension indicated by `dim`, which is replaced by a dimension `PC` of size `n_components` * *[pca_object]* -- The trained PCA object produced by scikit-learn, if return_pca_object=True .. py:function:: lda(da, dim, cats, n_components=2) .. py:function:: pls(xda, yda, n_components=2, common_dim=None) .. py:function:: pls_ds(ds, xname, yname, n_components=2)