remove useless PCA file
This commit is contained in:
parent
f19a9b4b71
commit
838e1d8764
1 changed files with 0 additions and 23 deletions
23
pca.py
23
pca.py
|
@ -1,23 +0,0 @@
|
|||
from sklearn.decomposition import PCA
|
||||
from matplotlib import pyplot as plt
|
||||
from simulation_list import SimulationList
|
||||
from mpl_toolkits.mplot3d import Axes3D
|
||||
import numpy as np
|
||||
simulations = SimulationList.jsonlines_load()
|
||||
np.set_printoptions(linewidth=1000,edgeitems=4)
|
||||
data = simulations.as_matrix
|
||||
simpledata=data[:, 4:]
|
||||
pca = PCA(n_components=3)
|
||||
pca.fit(simpledata)
|
||||
print(pca.components_)
|
||||
X_pca = pca.transform(simpledata)
|
||||
X_new = pca.inverse_transform(X_pca)
|
||||
print(X_pca)
|
||||
|
||||
|
||||
fig = plt.figure()
|
||||
ax = Axes3D(fig)
|
||||
# ax.scatter(simpledata[:, 0],simpledata[:, 1], simpledata[:, 2])
|
||||
# plt.show()
|
||||
ax.scatter(X_new[:, 0],X_new[:, 1], X_new[:, 2])
|
||||
plt.show()
|
Reference in a new issue