This commit is contained in:
MaDerniszator 2024-12-20 12:39:59 +04:00
parent b77003a97a
commit c6a08076a5

View File

@ -89,8 +89,11 @@
"pca = PCA(n_components=2)\n",
"reduced_data = pca.fit_transform(X)\n",
"\n",
"# Преобразуем данные из cupy в numpy\n",
"reduced_data_np = reduced_data.get()\n",
"\n",
"# Визуализация данных\n",
"plt.scatter(reduced_data[:, 0], reduced_data[:, 1])\n",
"plt.scatter(reduced_data_np[:, 0], reduced_data_np[:, 1])\n",
"plt.title('Визуализация данных после PCA')\n",
"plt.xlabel('PC1')\n",
"plt.ylabel('PC2')\n",
@ -187,7 +190,11 @@
]
}
],
"metadata": {},
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}