Skip to content

Commit 26a68fc

Browse files
victorprincipePicoCentauri
authored andcommitted
Fixed typos and formatting problems.
1 parent 081b402 commit 26a68fc

File tree

7 files changed

+24
-17
lines changed

7 files changed

+24
-17
lines changed

examples/FeatureSelection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# %%
2121
#
22-
# For this, we will use the provided csd dataset, which has 100 features to select from.
22+
# For this, we will use the provided CSD dataset, which has 100 features to select from.
2323

2424
X, y = load_csd_1000r(return_X_y=True)
2525
X = StandardFlexibleScaler(column_wise=False).fit_transform(X)
@@ -69,7 +69,7 @@
6969
# Non-iterative feature selection with CUR + PCovR
7070
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7171
#
72-
# Computing a non-iterative CUR is more efficient, although can resultin poorer
72+
# Computing a non-iterative CUR is more efficient, although can result in poorer
7373
# performance for larger datasets. you can also use a greater number of
7474
# eigenvectors to compute the feature importance by varying ``k``, but ``k`` should
7575
# not exceed the number of targets, for optimal results.

examples/OrthogonalRegressionNonAnalytic.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242

4343
# %%
4444
#
45-
# These are coordinates of a 3-dimensional cube. We treat the points of the cube as samples
46-
# and the 3 dimensions as features x y z
45+
# Below are coordinates of a 3-dimensional cube. We treat the points of the cube as samples
46+
# and the 3 dimensions as features x, y, and z.
4747

4848
cube = np.array(
4949
[
@@ -61,13 +61,13 @@
6161

6262
# %%
6363
#
64-
# the x y coordinates of the cube
64+
# The x y coordinates of the cube are obtained as follows:
6565

6666
xy_plane_projected_cube = cube[:, [0, 1]]
6767

6868
# %%
6969
#
70-
# a square prism with a scaling applied on the z axis
70+
# A square prism, with scaling applied on the z axis, can be defined as such:
7171

7272

7373
def z_scaled_square_prism(z_scaling):
@@ -207,7 +207,7 @@ def z_scaled_square_prism(z_scaling):
207207
# %%
208208
#
209209
# The projection allows an optimal reconstruction of the cube while when not using a
210-
# projection the orthogonal condition does not allow the same reconstruction
210+
# projection the orthogonal condition does not allow the same reconstruction.
211211

212212

213213
fig, ax_xy = plt.subplots(figsize=(7.5, 4))

examples/PCovR-WHODataset.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# %%
2323
#
2424
# Load the Dataset
25-
# ----------------
25+
# ^^^^^^^^^^^^^^^^
2626

2727

2828
df = load_who_dataset()["data"]
@@ -47,7 +47,7 @@
4747

4848
# %%
4949
#
50-
# We are taking the logarithm of the population and GDP to avoid extreme distributions
50+
# Below, we take the logarithm of the population and GDP to avoid extreme distributions
5151

5252
log_scaled = ["SP.POP.TOTL", "NY.GDP.PCAP.CD"]
5353
for ls in log_scaled:
@@ -80,7 +80,10 @@
8080
# Train the Different Linear DR Techniques
8181
# ----------------------------------------
8282
#
83-
# Best Error for Linear Regression
83+
# Below, we obtain the regression errors using a variety of linear DR techniques.
84+
#
85+
# Linear Regression
86+
# ^^^^^^^^^^^^^^^^^
8487

8588
RidgeCV(cv=5, alphas=np.logspace(-8, 2, 20), fit_intercept=False).fit(
8689
X_train, y_train
@@ -153,8 +156,10 @@
153156

154157

155158
# %%
159+
# Below, we obtain the regression errors using a variety of kernel DR techniques.
156160
#
157-
# Best Error for Kernel Regression
161+
# Kernel Regression
162+
# ^^^^^^^^^^^^^^^^^
158163

159164
gs.best_score_
160165

examples/PCovR.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
# %%
2525
#
26-
# For this, we will use the :func:`sklearn.datasets.load_diabetes` dataset from sklearn.
26+
# For this, we will use the :func:`sklearn.datasets.load_diabetes` dataset from ``sklearn``.
2727

2828
X, y = load_diabetes(return_X_y=True)
2929
y = y.reshape(X.shape[0], -1)
@@ -37,6 +37,7 @@
3737
# %%
3838
#
3939
# Computing a simple PCovR and making a fancy plot of the results
40+
# ---------------------------------------------------------------
4041

4142
mixing = 0.5
4243
pcovr = PCovR(
@@ -71,7 +72,8 @@
7172

7273
# %%
7374
#
74-
# Surveying Many Mixing Parameters
75+
# Surveying many Mixing Parameters
76+
# --------------------------------
7577

7678
n_alpha = 5
7779

@@ -165,4 +167,4 @@
165167
# you are comparing before constructing a kernel, for example, whether the analysis is
166168
# to be based on whole structures or individual atomic environments. For more detail,
167169
# see Appendix C of `Helfrecht 2020 <https://iopscience.iop.org/article/10.1088/2632-2153/aba9ef>`_
168-
# or regarding kernels involving gradients `Musil 2021 <https://arxiv.org/pdf/2101.08814.pdf>`_.
170+
# or, regarding kernels involving gradients, `Musil 2021 <https://arxiv.org/pdf/2101.08814.pdf>`_.

examples/PCovR_Regressors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# %%
1818
#
19-
# For this, we will use the :func:`sklearn.datasets.load_diabetes` dataset from sklearn.
19+
# For this, we will use the :func:`sklearn.datasets.load_diabetes` dataset from ``sklearn``.
2020

2121
mixing = 0.5
2222

examples/PlotGFRE.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
different, but have the same 3-body features. For more details about the dataset
1616
please refer to `Pozdnyakov 2020 <https://doi.org/10.1103/PhysRevLett.125.166001>`_.
1717
18-
The skmatter dataset already contains the 3 and 4-body features computed with
18+
The ``skmatter`` dataset already contains the 3 and 4-body features computed with
1919
`librascal <https://github.com/lab-cosmo/librascal>`_ so we can load it and
2020
compare it with the GFRE/GFRD.
2121
"""

examples/PlotLFRE.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128

129129
# %%
130130
#
131-
# The environments span a manifold which is described by the coordinates :math`v/\pi` and
131+
# The environments span a manifold which is described by the coordinates :math:`v/\pi` and
132132
# :math:`u/\pi` (please refer to `Pozdnyakov 2020 <https://doi.org/10.1103/PhysRevLett.125.166001>`_
133133
# for a concrete understanding of the manifold). The LFRE is presented for each environment
134134
# in the manifold in the two contour plots. It can be seen that the reconstruction error

0 commit comments

Comments
 (0)