multi-dimensional-scaling

How to plot a MDS from a similarity matrix?

强颜欢笑 提交于 2021-02-11 12:13:18
问题 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. I found multiple examples, but I'm not sure about what to give as an input to mds.fit(). For now, my data looks like that (file.csv) : ; A ; B ; C ; D ; E A ; 1 ; 0.1 ; 0.2 ; 0.5 ; 0.2 B ; 0.1 ; 1 ; 0.3 ; 1 ; 0 C ; 0.2 ; 0.3 ; 1 ; 0.8 ; 0.6 D ; 0.5 ; 1 ; 0.8 ; 1 ; 0.2 E ; 0.2 ; 0 ; 0.6 ; 0.2 ; 1 I'm currently using this code : import

How to use dissimilarity matrix with function metaMDS?

℡╲_俬逩灬. 提交于 2020-01-03 03:23:07
问题 I have a matrix derived from a table with three original columns: column 1 = site codes, column 2 = species codes and column 3 = biomass weight for each species. The biomass weight of each species in each plot is displayed in the matrix. The matrix can be calculated with one of the three following options (thanks to feedback on an earlier question): reshape::cast(dissimBiom, plot ~ species, value = 'biomass', fun = mean) by(dissimBiom, dissimBiom$biomass, function(x) with(x, table(plot,

5 dimensional plot in r

自古美人都是妖i 提交于 2019-12-31 08:53:15
问题 I am trying to plot a 5 dimensional plot in R. I am currently using the rgl package to plot my data in 4 dimensions, using 3 variables as the x,y,z, coordinates, another variable as the color. I am wondering if I can add a fifth variable using this package, like for example the size or the shape of the points in the space. Here's an example of my data, and my current code: set.seed(1) df <- data.frame(replicate(4,sample(1:200,1000,rep=TRUE))) addme <- data.frame(replicate(1,sample(0:1,1000

How to obtain the eigenvalues after performing Multidimensional scaling?

不羁岁月 提交于 2019-12-11 02:13:47
问题 I am interested in taking a look at the Eigenvalues after performing Multidimensional scaling. What function can do that ? I looked at the documentation, but it does not mention Eigenvalues at all. Here is a code sample: mds = manifold.MDS(n_components=100, max_iter=3000, eps=1e-9, random_state=seed, dissimilarity="precomputed", n_jobs=1) results = mds.fit(wordDissimilarityMatrix) # need a way to get the Eigenvalues 回答1: I also couldn't find it from reading the documentation. I suspect they

Multidimensional scaling with missing values in dissimilarity matrix

偶尔善良 提交于 2019-12-03 13:40:40
问题 I have a dissimilarity matrix on which I would like to perform multidimensional scaling (MDS) using the sklearn.manifold.MDS function. The dissimilarity between some elements in this matrix is not meaningful and I am thus wondering if there is a way to run MDS on a sparse matrix or on a matrix with missing values? According to this question, dissimilarities with 0 are considered as missing values, but I was unable to find this statement in the official documentation. Isn't a dissimilarity

5 dimensional plot in r

旧街凉风 提交于 2019-12-02 17:18:19
I am trying to plot a 5 dimensional plot in R. I am currently using the rgl package to plot my data in 4 dimensions, using 3 variables as the x,y,z, coordinates, another variable as the color. I am wondering if I can add a fifth variable using this package, like for example the size or the shape of the points in the space. Here's an example of my data, and my current code: set.seed(1) df <- data.frame(replicate(4,sample(1:200,1000,rep=TRUE))) addme <- data.frame(replicate(1,sample(0:1,1000,rep=TRUE))) df <- cbind(df,addme) colnames(df) <- c("var1","var2","var3","var4","var5") require(rgl)