Create README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
751298c482
commit
6eba6fe625
1 changed files with 45 additions and 0 deletions
45
scikit-learn/fast_ica/README.md
Normal file
45
scikit-learn/fast_ica/README.md
Normal file
|
@ -0,0 +1,45 @@
|
|||
# FastICA
|
||||
{:.no_toc}
|
||||
|
||||
<nav markdown="1" class="toc-class">
|
||||
* TOC
|
||||
{:toc}
|
||||
</nav>
|
||||
|
||||
## The goal
|
||||
|
||||
|
||||
Questions to [David Rotermund](mailto:davrot@uni-bremen.de)
|
||||
|
||||
## Test data
|
||||
|
||||
```python
|
||||
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, size=(5000))[:, np.newaxis] ** 3
|
||||
b_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis]
|
||||
data_b = np.concatenate((b_x, b_y), axis=1)
|
||||
|
||||
data = np.concatenate((data_a, data_b), axis=0)
|
||||
|
||||
angle_x = -0.3
|
||||
angle_y = 0.3
|
||||
|
||||
roation_matrix = np.array(
|
||||
[[np.cos(angle_x), -np.sin(angle_x)], [np.sin(angle_y), np.cos(angle_y)]]
|
||||
)
|
||||
data_r = data @ roation_matrix
|
||||
|
||||
plt.plot(data[:, 0], data[:, 1], "b.")
|
||||
plt.plot(data_r[:, 0], data_r[:, 1], "r.")
|
||||
plt.show()
|
||||
```
|
||||
|
||||
![image0](image0.png)
|
Loading…
Reference in a new issue