Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -112,9 +112,10 @@ def getstuff(openapikey):
|
|
112 |
|
113 |
# Convert to a list of lists of floats
|
114 |
matrix = np.array(tech_df['embedding'].to_list())
|
115 |
-
|
|
|
116 |
# Create a t-SNE model and transform the data
|
117 |
-
tsne = TSNE(n_components=2, perplexity=
|
118 |
vis_dims = tsne.fit_transform(matrix)
|
119 |
|
120 |
n_clusters = 5
|
|
|
112 |
|
113 |
# Convert to a list of lists of floats
|
114 |
matrix = np.array(tech_df['embedding'].to_list())
|
115 |
+
perplexityvalue=max(int(len(tech_df['embedding'].to_list()))/2,5) ###original value was a constant of 15
|
116 |
+
|
117 |
# Create a t-SNE model and transform the data
|
118 |
+
tsne = TSNE(n_components=2, perplexity=perplexityvalue, random_state=42, init='random', learning_rate=200)
|
119 |
vis_dims = tsne.fit_transform(matrix)
|
120 |
|
121 |
n_clusters = 5
|