I suppose I should transform my data? Which transformation should be used? In this link, they say the similarity are between 1 and -1.
Or does it use a distance matrix ? (In this case, how to obtain it from a similarity matrix ?) I'm a bit lost :( )ĭoes sklearn and MDS automatically understand the input ? (as a similarity or dissimilarity matrix with the 0 or 1 in the middle ?) (I read there that a simple substraction is enough. Should I make a transformation ? Or not ? If yes, which transformation should be done ? I read a lot of examples where people are using "dissimilarity matrix" with 0 in the middles (instead of 1). Plt.savefig( 'out.png', format= 'png', bbox_inches= 'tight') # PNG #plt.savefig('out.jpg', format='jpg', bbox_inches='tight') # JPG #plt.show() # Open display and show at screen # Add labels for i in range(data.shape):Īx.annotate(data.index, (points, points), color= 'blue') Plt.scatter(points, points, color= 'silver', s= 150) Mds = manifold.MDS(n_components= 2, random_state= 1, dissimilarity= "precomputed") I'm currently using this code : import pandasĭata = pandas.read_table( "file.csv", " ", header= 0, index_col= 0) I found multiple examples, but I'm not sure about what to give as an input to mds.fit().įor now, my data looks like that (file.csv) : A B C D E I'm using a similarity matrix with values between 0 and 1 (1 means that the elements are equals), and I'm trying to plot a MDS with python and scikit-learn.