Commit
·
2eb6e76
1
Parent(s):
3eacaec
Insert dimensionality reduction name
Browse files
views.py
CHANGED
|
@@ -10,6 +10,7 @@ import utils
|
|
| 10 |
import pandas as pd
|
| 11 |
from scipy.spatial import distance
|
| 12 |
|
|
|
|
| 13 |
|
| 14 |
def diffs(embeddings: np.ndarray, corrector):
|
| 15 |
st.text(f"Embedding shape: {embeddings.shape}")
|
|
@@ -24,7 +25,7 @@ def plot(df: pd.DataFrame, embeddings: np.ndarray, vectors_2d, reducer, correcto
|
|
| 24 |
y=vectors_2d[:, 1],
|
| 25 |
opacity=0.6,
|
| 26 |
hover_data={"Title": df["title"]},
|
| 27 |
-
labels={'x': '
|
| 28 |
title="UMAP Scatter Plot of Reddit Titles",
|
| 29 |
color_discrete_sequence=["#ff504c"] # Set default blue color for points
|
| 30 |
)
|
|
|
|
| 10 |
import pandas as pd
|
| 11 |
from scipy.spatial import distance
|
| 12 |
|
| 13 |
+
dimensionality_reduction_model_name = "PCA"
|
| 14 |
|
| 15 |
def diffs(embeddings: np.ndarray, corrector):
|
| 16 |
st.text(f"Embedding shape: {embeddings.shape}")
|
|
|
|
| 25 |
y=vectors_2d[:, 1],
|
| 26 |
opacity=0.6,
|
| 27 |
hover_data={"Title": df["title"]},
|
| 28 |
+
labels={'x': f'{dimensionality_reduction_model_name} Component 1', 'y': f'{dimensionality_reduction_model_name} Component 2'},
|
| 29 |
title="UMAP Scatter Plot of Reddit Titles",
|
| 30 |
color_discrete_sequence=["#ff504c"] # Set default blue color for points
|
| 31 |
)
|