Skip to content

Commit

Permalink
Update tsne_dim_reduction.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
do-me authored Apr 2, 2024
1 parent 6541415 commit e813423
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tsne_dim_reduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
"tsne_normalized = scaler.fit_transform(tsne_results)\n",
"\n",
"# Add the normalized 2D coordinates back to your DataFrame\n",
"df['x_norm'] = tsne_normalized[:,0]\n",
"df['x'] = tsne_normalized[:,0]\n",
"df['y'] = tsne_normalized[:,1]\n",
"\n",
"# Now you can plot the normalized results using matplotlib\n",
"plt.figure(figsize=(8, 6))\n",
"plt.scatter(df['x_norm'], df['y'], s=1) # You can also color the points by some label using the `c` argument\n",
"plt.scatter(df['x'], df['y'], s=1) # You can also color the points by some label using the `c` argument\n",
"plt.xlabel('Normalized t-SNE 2D One')\n",
"plt.ylabel('Normalized t-SNE 2D Two')\n",
"plt.title('2D t-SNE Visualization of Normalized Embeddings')\n",
Expand Down Expand Up @@ -94,7 +94,7 @@
" <th>TargetsNumber</th>\n",
" <th>Targets</th>\n",
" <th>jina-embeddings-v2-base-en</th>\n",
" <th>x_norm</th>\n",
" <th>x</th>\n",
" <th>y_norm</th>\n",
" </tr>\n",
" </thead>\n",
Expand Down Expand Up @@ -241,7 +241,7 @@
"167 By 2020, enhance capacity-building support to... \n",
"168 By 2030, build on existing initiatives to dev... \n",
"\n",
" jina-embeddings-v2-base-en x_norm y_norm \n",
" jina-embeddings-v2-base-en x y_norm \n",
"0 [0.013646188200000001, -0.8851571083, 0.273902... 0.474702 0.237202 \n",
"1 [-0.5175303221, -0.1017927676, 0.1907873154000... 0.508123 0.238149 \n",
"2 [-0.0685161054, -0.188393563, 0.4002646804, 0.... 0.702829 0.147774 \n",
Expand Down

0 comments on commit e813423

Please sign in to comment.