Questions tagged [tsne]
58 questions
0
votes
1 answer
Trying to Plot Closest Words Using TSNE in Word2Vec model
I can't figure out why I keep getting a ValueError messsage with the following code:
def display_closestwords_tsnescatterplot(test_model, word):
arr = np.empty((0,300), dtype='f')
word_labels = [word]
# get close words
…

Dez Miller
- 1
- 1
0
votes
0 answers
t-SNE r coding and pj|i matrix
equationI need to make the following equation into a function given data that is two columns of 200 rows and run this function in a for loop to get a matrix that is 200 rows and 200 columns.
I've tried just making a function for the denominator then…

NICOLA CHURCHILL
- 1
- 1
0
votes
0 answers
TSNE plot having Type Error must be real number, not str
I kept getting this error message when i tried doing TSNE plot :TypeError: must be real number, not str. I need help seriously.
below is my code:
y = df_new['binary']
X = df_new.drop('binary', axis = 1)
def tsne_plot(x, y):
# Setting the…

Kudjoe Erik
- 1
- 1
0
votes
0 answers
UMAP plot string labels next to dots
mapper = umap.UMAP(n_neighbors=5, metric='hamming').fit(data.drop('pid',axis=1))
umap.plot.points(mapper,labels=np.array(clusters['leaves_color_list']))
The result looks like this:
Instead of/In addition to colored dots, I'd like to plot the 'pid'…

Chris
- 15
- 3
0
votes
0 answers
T-distributed Stochastic Neighbor Embedding (t-SNE)
I am trying to run T-distributed Stochastic Neighbor Embedding (t-SNE) in Jupyter but always facing a issue with
ValueError: could not convert string to float: ''
Code:
enter image description here
import numpy as np
import pandas as…

Satya Prakash
- 1
- 1
0
votes
0 answers
How to prepare the input for T-SNE transform in pandas?
I am trying to visualize my dataset (which is stored as a Pandas DataFrame) using T-SNE with the following code:
N = 10000
df_subset = df.sample(n=N, random_state=1)
data_subset = df_subset.values
tsne = TSNE(n_components=2, verbose=1,…

robot
- 13
- 3
0
votes
1 answer
TSNE: ValueError: setting an array element with a sequence
I'm trying to pass a numpy array to TSNE in order compress that to 2 columns and after that plotting with seaborn. result is a dataframe that i've read from a csv.
arr=result.to_numpy()
n_components = 2
tsne =…

ccragusa
- 17
- 1
0
votes
1 answer
How to plot Tsne in matlab using specific color
I am trying to plot the result of Tsne using gscatter in Matlab.
I want to use specific color for training and other color for Anchors
Y=tsne(xtrain; xAnxhors]);
gscatter(Y(:,1),Y(:,2));
That is the code that I used but I got the figure in one…

user9010429
- 21
- 3
0
votes
0 answers
pyspark tsne dimension reduction
Is there a way to implement dimension reduction using pyspark?
I have a dataframe and loaded into pyspark.
FILENAME = "test.csv"
spark = SparkSession.builder.appName('Test') \
.getOrCreate()
spark_df = spark.read.csv(FILENAME, header=True)
#…

just want to learn
- 25
- 5
0
votes
1 answer
Should I separate my data into different batches and then perform tsne on each batch?
I have a very huge dataset and required to reduce the embedding of 768 dimension to 128dimension with TSNE. Since I have more than 1million rows, it takes more than weeks to complete dimension reduction on whole dataset, so I thought maybe I can…

just want to learn
- 25
- 5
0
votes
1 answer
Why do my t-SNE plots with euclidean and cosine distances look similar
I have a question about two t-SNE plots I made.
I have a set of 850 articles for which I wanted to check which articles are similar to each other.
This was done by pre-processing the articles first, then making a tf-idf vector of the whole set and…

HenkieTee
- 21
- 5
0
votes
1 answer
T-SNE for better data visualization
My dataset shape is (248857, 11)
This is how it looks like before StandartScaler. I performed clustering analysis because of those clustering algorithms such as K-means do need feature scaling before they are fed to the algo.
After
I performed…

linuxpanther
- 69
- 7
0
votes
1 answer
Two ways of computing t-SNE plot with cosine similarity ends in different plots, but the method seems the same
I have been looking at this for the past hour but can not seem to find the problem...
I have a list of articles on which I want to see which articles are similar to each other.
I have done this by computing the cosine similarities between the TF-IDF…

HenkieTee
- 21
- 5
0
votes
0 answers
gradient descent update rule in sklearn's tSNE implementation
In sklearn's tSNE implementation, the gradient update is done as follows (gradient_descent function in _t_sne.py on sklearn's github):
error, grad = objective(p, *args, **kwargs)
grad_norm = linalg.norm(grad)
inc = update * grad < 0.0
…

futuref
- 1
- 1
0
votes
1 answer
Different results after repeating TSNE after KMeans clustering
I'm using sklearn.manifold.TSNE to project onto 2-dimensional space a dataset that I've separately clustered using sklearn.clustering.KMeans. My code is the following:
clustering = KMeans(n_clusters=5, random_state=5)
clustering.fit(X)
tsne =…

James Arten
- 523
- 5
- 16