From 0e1d581a9b19bac4b6812dd9fa0ed76ac213ed6f Mon Sep 17 00:00:00 2001 From: Alexander Goscinski Date: Fri, 28 Jul 2023 00:20:04 +0200 Subject: [PATCH] clean up malformatted doc elements --- docs/src/preprocessing.rst | 25 +++++++++++++++++++++++-- docs/src/utils.rst | 2 +- src/skmatter/preprocessing/_data.py | 9 +++++---- src/skmatter/utils/_orthogonalizers.py | 2 +- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/docs/src/preprocessing.rst b/docs/src/preprocessing.rst index 4baaeabd7..7252ddc60 100644 --- a/docs/src/preprocessing.rst +++ b/docs/src/preprocessing.rst @@ -1,7 +1,28 @@ Preprocessing ============= -.. automodule:: skmatter.preprocessing + +KernelNormalizer +---------------- + +.. autoclass:: skmatter.preprocessing.KernelNormalizer + :members: + :undoc-members: + :inherited-members: + + +SparseKernelCenterer +-------------------- + +.. autoclass:: skmatter.preprocessing.SparseKernelCenterer + :members: + :undoc-members: + :inherited-members: + +StandardFlexibleScaler +---------------------- + +.. autoclass:: skmatter.preprocessing.StandardFlexibleScaler :members: :undoc-members: - :show-inheritance: + :inherited-members: diff --git a/docs/src/utils.rst b/docs/src/utils.rst index bae996748..8b2c6560a 100644 --- a/docs/src/utils.rst +++ b/docs/src/utils.rst @@ -33,4 +33,4 @@ for feature and sample selection. Random Partitioning with Overlaps ################################# -.. automodule:: skmatter.model_selection._split +.. autofunction:: skmatter.model_selection.train_test_split diff --git a/src/skmatter/preprocessing/_data.py b/src/skmatter/preprocessing/_data.py index 9e4651466..07160dea4 100644 --- a/src/skmatter/preprocessing/_data.py +++ b/src/skmatter/preprocessing/_data.py @@ -232,10 +232,11 @@ class KernelNormalizer(KernelCenterer): """Kernel centering method, similar to KernelCenterer, but with additional scaling and ability to pass a set of sample weights. - Let K(x, z) be a kernel defined by phi(x)^T phi(z), where phi is a - function mapping x to a Hilbert space. KernelNormalizer centers (i.e., - normalize to have zero mean) the data without explicitly computing phi(x). - It is equivalent to centering and scaling phi(x) with + Let :math:`K(x, z)` be a kernel defined by :math:`\\phi(x)^T \\phi(z)`, + where :math:`\\phi` is a function mapping x to a Hilbert space. + KernelNormalizer centers (i.e., normalize to have zero mean) the data without + explicitly computing :math:`\\phi(x)`. + It is equivalent to centering and scaling :math:`\\phi(x)` with sklearn.preprocessing.StandardScaler(with_std=False). Parameters diff --git a/src/skmatter/utils/_orthogonalizers.py b/src/skmatter/utils/_orthogonalizers.py index 4bfba3739..14dbf0a2c 100644 --- a/src/skmatter/utils/_orthogonalizers.py +++ b/src/skmatter/utils/_orthogonalizers.py @@ -100,7 +100,7 @@ def Y_feature_orthogonalizer(y, X, tol=1e-12, copy=True): def Y_sample_orthogonalizer(y, X, y_ref, X_ref, tol=1e-12, copy=True): """ - Orthogonalizes a matrix of targets :math:`{\\mathbf{Y}}`given a reference feature + Orthogonalizes a matrix of targets :math:`{\\mathbf{Y}}` given a reference feature matrix :math:`{\\mathbf{X}_r}` and reference target matrix :math:`{\\mathbf{Y}_r}`: .. math::