Help us understand the problem. What is going on with this article?

# Scikit-learnでラプラス固有写像(laplacian eigenmaps)（自分用メモ）

More than 5 years have passed since last update.

# 参考コード

ロールケーキを2次元部分空間に埋め込む。

```# codeing: utf-8

import numpy as np
from numpy.random import uniform
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

from sklearn import manifold

n=1000
k=10

a=np.array(3*np.pi*uniform(0,1,n), dtype=np.float64)
x = np.vstack((a*np.cos(a), 30*uniform(0,1,n), a*np.sin(a)))

fig = plt.figure()
ax = Axes3D(fig)
ax.scatter(x[0,:],x[1,:],x[2,:], c=x[0,:]+x[2,:])
plt.show()

embedder = manifold.SpectralEmbedding(n_components=2, random_state=0, n_neighbors=k,
eigen_solver="arpack")
x_se = embedder.fit_transform(x.T)

plt.scatter(x_se[:,0],x_se[:,1], c=x_se[:,0]+x_se[:,1])
plt.show()
```

# 出力結果

## 2Dロールケーキ

Why not register and get more from Qiita?
1. We will deliver articles that match you
By following users and tags, you can catch up information on technical fields that you are interested in as a whole
2. you can read useful information later efficiently
By "stocking" the articles you like, you can search right away