8000 Bring last code block in line with the image. (#9488) · dmohns/scikit-learn@c87351f · GitHub
[go: up one dir, main page]

Skip to content

Commit c87351f

Browse files
julesjuliandmohns
authored andcommitted
1 parent fbfa0b9 commit c87351f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

doc/tutorial/statistical_inference/unsupervised_learning.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,17 @@ a maximum amount of independent information. It is able to recover
305305
::
306306

307307
>>> # Generate sample data
308+
>>> import numpy as np
309+
>>> from scipy import signal
308310
>>> time = np.linspace(0, 10, 2000)
309311
>>> s1 = np.sin(2 * time) # Signal 1 : sinusoidal signal
310312
>>> s2 = np.sign(np.sin(3 * time)) # Signal 2 : square signal
311-
>>> S = np.c_[s1, s2]
313+
>>> s3 = signal.sawtooth(2 * np.pi * time) # Signal 3: saw tooth signal
314+
>>> S = np.c_[s1, s2, s3]
312315
>>> S += 0.2 * np.random.normal(size=S.shape) # Add noise
313316
>>> S /= S.std(axis=0) # Standardize data
314317
>>> # Mix data
315-
>>> A = np.array([[1, 1], [0.5, 2]]) # Mixing matrix
318+
>>> A = np.array([[1, 1, 1], [0.5, 2, 1], [1.5, 1, 2]]) # Mixing matrix
316319
>>> X = np.dot(S, A.T) # Generate observations
317320

318321
>>> # Compute ICA

0 commit comments

Comments
 (0)
0