Если я правильно понимаю, вы в основном хотите создать диаграмму рассеяния X = TSNE Компонент 1, Y = TSNE Компонент 2 и закрасить целевой переменной (положительной или отрицательной)
Следующий пример кода достигает этого::
tsneDf = pd.DataFrame(data = tsne_data ,columns = ['TSNE component 1',
'TSNE component 2'])
#Create a dataframe of TSNE Compoenent and the Score Column
finalDf = pd.concat([tsneDf, df[['ScoreColumn']]], axis = 1)
#Now we jsut plot a scatter plot
fig = plt.figure(figsize = (8,8))
ax = fig.add_subplot(1,1,1)
ax.set_xlabel('TSNE Component 1', fontsize = 15)
ax.set_ylabel('TSNE Component 2', fontsize = 15)
ax.set_title('2 component TSNE', fontsize = 20)
#In this example 0:Negative and 1:Positive and we map respective colour
targets = [0, 1]
colors = ['r', 'g']
for target, color in zip(targets,colors):
indicesToKeep = finalDf['ScoreColumn'] == target
ax.scatter(finalDf.loc[indicesToKeep, 'TSNE component 1']
, finalDf.loc[indicesToKeep, 'TSNE component 2']
, c = color
, s = 25,alpha=0.4)
ax.legend(targets)
ax.grid()
Образец Результат выглядит следующим образом (для моих данных) ![enter image description here](https://i.stack.imgur.com/hjbTK.png)