<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mscneuro.neuro.uni-bremen.de/index.php?action=history&amp;feed=atom&amp;title=FastICA</id>
	<title>FastICA - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mscneuro.neuro.uni-bremen.de/index.php?action=history&amp;feed=atom&amp;title=FastICA"/>
	<link rel="alternate" type="text/html" href="https://mscneuro.neuro.uni-bremen.de/index.php?title=FastICA&amp;action=history"/>
	<updated>2026-10-11T23:46:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://mscneuro.neuro.uni-bremen.de/index.php?title=FastICA&amp;diff=406&amp;oldid=prev</id>
		<title>Davrot at 17:16, 17 October 2025</title>
		<link rel="alternate" type="text/html" href="https://mscneuro.neuro.uni-bremen.de/index.php?title=FastICA&amp;diff=406&amp;oldid=prev"/>
		<updated>2025-10-17T17:16:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:16, 17 October 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== The goal ==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Questions to [mailto:davrot@uni-bremen.de David Rotermund]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Questions to [mailto:davrot@uni-bremen.de David Rotermund]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l36&quot;&gt;Line 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 35:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The implementation is based on [https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#r44c805292efc-1 1].&amp;lt;/blockquote&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;fit(X, y=None)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;Fit the model to X.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The implementation is based on [https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#r44c805292efc-1 1].&amp;lt;/blockquote&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;fit(X, y=None)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;Fit the model to X.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;X&#039;&#039;&#039; : array-like of shape (n_samples, n_features)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;X&#039;&#039;&#039;: array-like of shape (n_samples, n_features)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Training data, where n_samples is the number of samples and n_features is the number of features.&amp;lt;/blockquote&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;transform(X, copy=True)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;Recover the sources from X (apply the unmixing matrix).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Training data, where n_samples is the number of samples and n_features is the number of features.&amp;lt;/blockquote&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;transform(X, copy=True)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;Recover the sources from X (apply the unmixing matrix).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;X&#039;&#039;&#039; : array-like of shape (n_samples, n_features)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;X&#039;&#039;&#039;: array-like of shape (n_samples, n_features)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Data to transform, where n_samples is the number of samples and n_features is the number of features.&amp;lt;/blockquote&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;import numpy as np&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Data to transform, where n_samples is the number of samples and n_features is the number of features.&amp;lt;/blockquote&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;import numpy as np&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Davrot</name></author>
	</entry>
	<entry>
		<id>https://mscneuro.neuro.uni-bremen.de/index.php?title=FastICA&amp;diff=291&amp;oldid=prev</id>
		<title>Davrot: Created page with &quot;== The goal == Questions to [mailto:davrot@uni-bremen.de David Rotermund]  == Test data == We rotate the blue dots with ​a non-orthogonal rotation matrix into the red dots.&lt;syntaxhighlight lang=&quot;python&quot;&gt;import numpy as np import matplotlib.pyplot as plt  rng = np.random.default_rng(1)  a_x = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] a_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] ** 3 data_a = np.concatenate((a_x, a_y), axis=1)  b_x = rng.normal(0.0, 1.0,...&quot;</title>
		<link rel="alternate" type="text/html" href="https://mscneuro.neuro.uni-bremen.de/index.php?title=FastICA&amp;diff=291&amp;oldid=prev"/>
		<updated>2025-10-17T15:35:38Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== The goal == Questions to [mailto:davrot@uni-bremen.de David Rotermund]  == Test data == We rotate the blue dots with ​a non-orthogonal rotation matrix into the red dots.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;import numpy as np import matplotlib.pyplot as plt  rng = np.random.default_rng(1)  a_x = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] a_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] ** 3 data_a = np.concatenate((a_x, a_y), axis=1)  b_x = rng.normal(0.0, 1.0,...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== The goal ==&lt;br /&gt;
Questions to [mailto:davrot@uni-bremen.de David Rotermund]&lt;br /&gt;
&lt;br /&gt;
== Test data ==&lt;br /&gt;
We rotate the blue dots with ​a non-orthogonal rotation matrix into the red dots.&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
&lt;br /&gt;
rng = np.random.default_rng(1)&lt;br /&gt;
&lt;br /&gt;
a_x = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis]&lt;br /&gt;
a_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] ** 3&lt;br /&gt;
data_a = np.concatenate((a_x, a_y), axis=1)&lt;br /&gt;
&lt;br /&gt;
b_x = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] ** 3&lt;br /&gt;
b_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis]&lt;br /&gt;
data_b = np.concatenate((b_x, b_y), axis=1)&lt;br /&gt;
&lt;br /&gt;
data = np.concatenate((data_a, data_b), axis=0)&lt;br /&gt;
&lt;br /&gt;
angle_x = -0.3&lt;br /&gt;
angle_y = 0.3&lt;br /&gt;
&lt;br /&gt;
roation_matrix = np.array(&lt;br /&gt;
    [[np.cos(angle_x), -np.sin(angle_x)], [np.sin(angle_y), np.cos(angle_y)]]&lt;br /&gt;
)&lt;br /&gt;
data_r = data @ roation_matrix&lt;br /&gt;
&lt;br /&gt;
plt.plot(data[:, 0], data[:, 1], &amp;quot;b.&amp;quot;)&lt;br /&gt;
plt.plot(data_r[:, 0], data_r[:, 1], &amp;quot;r.&amp;quot;)&lt;br /&gt;
plt.show()&amp;lt;/syntaxhighlight&amp;gt;[[File:14 0.png]]&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Train and use [https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#sklearn.decomposition.FastICA FastICA​] ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;class sklearn.decomposition.FastICA(n_components=None, *, algorithm=&amp;#039;parallel&amp;#039;, whiten=&amp;#039;unit-variance&amp;#039;, fun=&amp;#039;logcosh&amp;#039;, fun_args=None, max_iter=200, tol=0.0001, w_init=None, whiten_solver=&amp;#039;svd&amp;#039;, random_state=None)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;FastICA: a fast algorithm for Independent Component Analysis.&lt;br /&gt;
&lt;br /&gt;
The implementation is based on [https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#r44c805292efc-1 1].&amp;lt;/blockquote&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;fit(X, y=None)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;Fit the model to X.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;X&amp;#039;&amp;#039;&amp;#039; : array-like of shape (n_samples, n_features)&lt;br /&gt;
&lt;br /&gt;
Training data, where n_samples is the number of samples and n_features is the number of features.&amp;lt;/blockquote&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;transform(X, copy=True)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;Recover the sources from X (apply the unmixing matrix).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;X&amp;#039;&amp;#039;&amp;#039; : array-like of shape (n_samples, n_features)&lt;br /&gt;
&lt;br /&gt;
Data to transform, where n_samples is the number of samples and n_features is the number of features.&amp;lt;/blockquote&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
from sklearn.decomposition import FastICA&lt;br /&gt;
&lt;br /&gt;
rng = np.random.default_rng(1)&lt;br /&gt;
&lt;br /&gt;
a_x = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis]&lt;br /&gt;
a_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] ** 3&lt;br /&gt;
data_a = np.concatenate((a_x, a_y), axis=1)&lt;br /&gt;
&lt;br /&gt;
b_x = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] ** 3&lt;br /&gt;
b_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis]&lt;br /&gt;
data_b = np.concatenate((b_x, b_y), axis=1)&lt;br /&gt;
&lt;br /&gt;
data = np.concatenate((data_a, data_b), axis=0)&lt;br /&gt;
&lt;br /&gt;
angle_x = -0.3&lt;br /&gt;
angle_y = 0.3&lt;br /&gt;
&lt;br /&gt;
roation_matrix = np.array(&lt;br /&gt;
    [[np.cos(angle_x), -np.sin(angle_x)], [np.sin(angle_y), np.cos(angle_y)]]&lt;br /&gt;
)&lt;br /&gt;
data_r = data @ roation_matrix&lt;br /&gt;
&lt;br /&gt;
# Train&lt;br /&gt;
ica = FastICA(n_components=2)&lt;br /&gt;
ica.fit(data_r)&lt;br /&gt;
&lt;br /&gt;
# Use&lt;br /&gt;
transformed_data = ica.transform(data_r)&lt;br /&gt;
&lt;br /&gt;
plt.plot(transformed_data[:, 0], transformed_data[:, 1], &amp;quot;k.&amp;quot;)&lt;br /&gt;
plt.show()&amp;lt;/syntaxhighlight&amp;gt;[[File:14 1.png]]&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Use FastICA to transform the un-rotated data ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;inverse_transform(X, copy=True)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;blockquote&amp;gt;Transform the sources back to the mixed data (apply mixing matrix). &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;X&amp;#039;&amp;#039;&amp;#039;: array-like of shape (n_samples, n_components)&lt;br /&gt;
&lt;br /&gt;
Sources, where n_samples is the number of samples and n_components is the number of components.&amp;lt;/blockquote&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
from sklearn.decomposition import FastICA&lt;br /&gt;
&lt;br /&gt;
rng = np.random.default_rng(1)&lt;br /&gt;
&lt;br /&gt;
a_x = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis]&lt;br /&gt;
a_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] ** 3&lt;br /&gt;
data_a = np.concatenate((a_x, a_y), axis=1)&lt;br /&gt;
&lt;br /&gt;
b_x = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] ** 3&lt;br /&gt;
b_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis]&lt;br /&gt;
data_b = np.concatenate((b_x, b_y), axis=1)&lt;br /&gt;
&lt;br /&gt;
data = np.concatenate((data_a, data_b), axis=0)&lt;br /&gt;
&lt;br /&gt;
angle_x = -0.3&lt;br /&gt;
angle_y = 0.3&lt;br /&gt;
&lt;br /&gt;
roation_matrix = np.array(&lt;br /&gt;
    [[np.cos(angle_x), -np.sin(angle_x)], [np.sin(angle_y), np.cos(angle_y)]]&lt;br /&gt;
)&lt;br /&gt;
data_r = data @ roation_matrix&lt;br /&gt;
&lt;br /&gt;
# Train&lt;br /&gt;
ica = FastICA(n_components=2)&lt;br /&gt;
ica.fit(data_r)&lt;br /&gt;
&lt;br /&gt;
# Use&lt;br /&gt;
transformed_data = ica.inverse_transform(data)&lt;br /&gt;
&lt;br /&gt;
plt.plot(transformed_data[:, 0], transformed_data[:, 1], &amp;quot;k.&amp;quot;)&lt;br /&gt;
plt.show()&amp;lt;/syntaxhighlight&amp;gt;[[File:14 2.png]]&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inspect the extracted coordinate system ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;#039;&amp;#039;&amp;#039;components_&amp;#039;&amp;#039;&amp;#039;: ndarray of shape (n_components, n_features)&lt;br /&gt;
&lt;br /&gt;
The linear operator to apply to the data to get the independent sources. This is equal to the unmixing matrix when whiten is False, and equal to np.dot(unmixing_matrix, self.whitening_) when whiten is True.&amp;lt;/blockquote&amp;gt;&amp;#039;&amp;#039;&amp;#039;Be aware that the sign of any axis can switch !!!&amp;#039;&amp;#039;&amp;#039;​ Like it happend in this example:&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;import numpy as np&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
from sklearn.decomposition import FastICA&lt;br /&gt;
&lt;br /&gt;
rng = np.random.default_rng(1)&lt;br /&gt;
&lt;br /&gt;
a_x = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis]&lt;br /&gt;
a_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] ** 3&lt;br /&gt;
data_a = np.concatenate((a_x, a_y), axis=1)&lt;br /&gt;
&lt;br /&gt;
b_x = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] ** 3&lt;br /&gt;
b_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis]&lt;br /&gt;
data_b = np.concatenate((b_x, b_y), axis=1)&lt;br /&gt;
&lt;br /&gt;
data = np.concatenate((data_a, data_b), axis=0)&lt;br /&gt;
&lt;br /&gt;
angle_x = -0.3&lt;br /&gt;
angle_y = 0.3&lt;br /&gt;
&lt;br /&gt;
roation_matrix = np.array(&lt;br /&gt;
    [[np.cos(angle_x), -np.sin(angle_x)], [np.sin(angle_y), np.cos(angle_y)]]&lt;br /&gt;
)&lt;br /&gt;
data_r = data @ roation_matrix&lt;br /&gt;
&lt;br /&gt;
# Train&lt;br /&gt;
ica = FastICA(n_components=2)&lt;br /&gt;
ica.fit(data_r)&lt;br /&gt;
&lt;br /&gt;
plt.plot([-ica.components_.max(), ica.components_.max()], [0, 0], &amp;quot;k&amp;quot;)&lt;br /&gt;
plt.plot([0, 0], [-ica.components_.max(), ica.components_.max()], &amp;quot;k&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
plt.plot(&lt;br /&gt;
    [-ica.components_[0, 0], ica.components_[0, 0]],&lt;br /&gt;
    [-ica.components_[0, 1], ica.components_[0, 1]],&lt;br /&gt;
    &amp;quot;m&amp;quot;,&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
plt.plot(&lt;br /&gt;
    [-ica.components_[1, 0], ica.components_[1, 0]],&lt;br /&gt;
    [-ica.components_[1, 1], ica.components_[1, 1]],&lt;br /&gt;
    &amp;quot;c&amp;quot;,&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
plt.show()&amp;lt;/syntaxhighlight&amp;gt;[[File:14 3.png]]&amp;lt;div class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fast ICA Methods ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#sklearn.decomposition.FastICA.fit fit](X[, y])&lt;br /&gt;
|Fit the model to X.&lt;br /&gt;
|-&lt;br /&gt;
|[https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#sklearn.decomposition.FastICA.fit_transform fit_transform](X[, y])&lt;br /&gt;
|Fit the model and recover the sources from X.&lt;br /&gt;
|-&lt;br /&gt;
|[https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#sklearn.decomposition.FastICA.get_feature_names_out get_feature_names_out]([input_features])&lt;br /&gt;
|Get output feature names for transformation.&lt;br /&gt;
|-&lt;br /&gt;
|[https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#sklearn.decomposition.FastICA.get_metadata_routing get_metadata_routing]()&lt;br /&gt;
|Get metadata routing of this object.&lt;br /&gt;
|-&lt;br /&gt;
|[https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#sklearn.decomposition.FastICA.get_params get_params]([deep])&lt;br /&gt;
|Get parameters for this estimator.&lt;br /&gt;
|-&lt;br /&gt;
|[https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#sklearn.decomposition.FastICA.inverse_transform inverse_transform](X[, copy])&lt;br /&gt;
|Transform the sources back to the mixed data (apply mixing matrix).&lt;br /&gt;
|-&lt;br /&gt;
|[https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#sklearn.decomposition.FastICA.set_inverse_transform_request set_inverse_transform_request](*[, copy])&lt;br /&gt;
|Request metadata passed to the inverse_transform method.&lt;br /&gt;
|-&lt;br /&gt;
|[https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#sklearn.decomposition.FastICA.set_output set_output](*[, transform])&lt;br /&gt;
|Set output container.&lt;br /&gt;
|-&lt;br /&gt;
|[https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#sklearn.decomposition.FastICA.set_params set_params](**params)&lt;br /&gt;
|Set the parameters of this estimator.&lt;br /&gt;
|-&lt;br /&gt;
|[https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#sklearn.decomposition.FastICA.set_transform_request set_transform_request](*[, copy])&lt;br /&gt;
|Request metadata passed to the transform method.&lt;br /&gt;
|-&lt;br /&gt;
|[https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.FastICA.html#sklearn.decomposition.FastICA.transform transform](X[, copy])&lt;br /&gt;
|Recover the sources from X (apply the unmixing matrix).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Fast ICA Attributes ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;#039;&amp;#039;&amp;#039;components_&amp;#039;&amp;#039;&amp;#039;: ndarray of shape (n_components, n_features)&lt;br /&gt;
&lt;br /&gt;
The linear operator to apply to the data to get the independent sources. This is equal to the unmixing matrix when whiten is False, and equal to np.dot(unmixing_matrix, self.whitening_) when whiten is True.&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;&amp;#039;&amp;#039;&amp;#039;mixing_&amp;#039;&amp;#039;&amp;#039;: ndarray of shape (n_features, n_components)&lt;br /&gt;
&lt;br /&gt;
The pseudo-inverse of components_. It is the linear operator that maps independent sources to the data.&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;&amp;#039;&amp;#039;&amp;#039;mean_&amp;#039;&amp;#039;&amp;#039;: ndarray of shape(n_features,)&lt;br /&gt;
&lt;br /&gt;
The mean over features. Only set if self.whiten is True.&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;&amp;#039;&amp;#039;&amp;#039;n_features_in_&amp;#039;&amp;#039;&amp;#039;: int&lt;br /&gt;
&lt;br /&gt;
Number of features seen during fit.&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;&amp;#039;&amp;#039;&amp;#039;feature_names_in_&amp;#039;&amp;#039;&amp;#039;: ndarray of shape (n_features_in_,)&lt;br /&gt;
&lt;br /&gt;
Names of features seen during fit. Defined only when X has feature names that are all strings.&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;&amp;#039;&amp;#039;&amp;#039;n_iter_&amp;#039;&amp;#039;&amp;#039;: int&lt;br /&gt;
&lt;br /&gt;
If the algorithm is “deflation”, n_iter is the maximum number of iterations run across all components. Else they are just the number of iterations taken to converge.&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;&amp;#039;&amp;#039;&amp;#039;whitening_&amp;#039;&amp;#039;&amp;#039;: ndarray of shape (n_components, n_features)&lt;br /&gt;
&lt;br /&gt;
Only set if whiten is ‘True’. This is the pre-whitening matrix that projects data onto the first n_components principal components.&amp;lt;/blockquote&amp;gt;&lt;/div&gt;</summary>
		<author><name>Davrot</name></author>
	</entry>
</feed>