From b177af057c030f402602010a5c3f9af201950f8d Mon Sep 17 00:00:00 2001 From: Julian Kuhlmann Date: Thu, 3 Aug 2017 11:30:47 -0700 Subject: [PATCH] Bring last code block in line with the image. Code from http://scikit-learn.org/stable/auto_examples/decomposition/plot_ica_blind_source_separation.html. --- .../statistical_inference/unsupervised_learning.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/tutorial/statistical_inference/unsupervised_learning.rst b/doc/tutorial/statistical_inference/unsupervised_learning.rst index be32fabd96cb8..afe51320414c6 100644 --- a/doc/tutorial/statistical_inference/unsupervised_learning.rst +++ b/doc/tutorial/statistical_inference/unsupervised_learning.rst @@ -305,14 +305,17 @@ a maximum amount of independent information. It is able to recover :: >>> # Generate sample data + >>> import numpy as np + >>> from scipy import signal >>> time = np.linspace(0, 10, 2000) >>> s1 = np.sin(2 * time) # Signal 1 : sinusoidal signal >>> s2 = np.sign(np.sin(3 * time)) # Signal 2 : square signal - >>> S = np.c_[s1, s2] + >>> s3 = signal.sawtooth(2 * np.pi * time) # Signal 3: saw tooth signal + >>> S = np.c_[s1, s2, s3] >>> S += 0.2 * np.random.normal(size=S.shape) # Add noise >>> S /= S.std(axis=0) # Standardize data >>> # Mix data - >>> A = np.array([[1, 1], [0.5, 2]]) # Mixing matrix + >>> A = np.array([[1, 1, 1], [0.5, 2, 1], [1.5, 1, 2]]) # Mixing matrix >>> X = np.dot(S, A.T) # Generate observations >>> # Compute ICA