问题标签 [multi-dimensional-scaling]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
407 浏览

r - R中的多维缩放图

我有一个如下所示的数据集(“数据”)

我需要生成一个包含所有数据点的 MDS 图。我还需要将访问点通过一条线连接起来,访问 1 的颜色为绿色,访问 2 的颜色为红色,访问 3 的颜色为黑色(所有个人的颜色一致)。

我的代码看起来像这样(很长,但它不起作用):

我将衷心感谢您的帮助。

0 投票
1 回答
1092 浏览

r - Multidimensional Histogram with R

Suppose we have a data frame like this:

We would like to compute a histogram on this data in all dimensions (i.e a, b, c, d, e) with specified breaks in each dimension. Obviously factor dimensions imply their breaks already. The final data should like like a data.frame where each row is a vector of breaks across all dimensions (combination of breaks) and the data occurrence count for this combination. Python numpy has histogramdd: Multidimension histogram in python. Is there something similar in R? What is the best way to do this in R? Thank you.

I ended up using the following, where bin counts are passed to the function as the last row:

0 投票
0 回答
54 浏览

r - 将列分配给分组变量以用于 ordihull 绘图

我有一个包含 12 个国家对的不同评级的数据框,我想做的基本上是将列(国家)分为三个不同的组(不结合他们的分数)。

我正在执行非度量多维缩放,所以我想根据这三个组绘制凸包的不同等级。

我知道制作绘图的代码,我所缺少的只是需要的分组变量,而且我一生都无法弄清楚如何创建它。

这可能是一个令人沮丧的简单命令,但我真的迷路了。

0 投票
1 回答
2029 浏览

normalization - 如何标准化数据以具有相同的平均平方和?

在我所在领域的许多文章中,重复了这句话:“已将 2 个矩阵归一化为具有相同的平均平方和(在所有主题和每种模态的所有体素上计算)”。假设我们有两个矩阵,行定义不同的主题,列是特征(体素)。在这些文章中,没有太多关于归一化方法的解释。有谁知道我应该如何规范化数据以具有“相同的平均平方和”?我完全不明白。谢谢

0 投票
6 回答
9093 浏览

python - 避免在 sci-kit learn StandsardScaler 中缩放二进制列

我正在 sci-kit learn 中构建线性回归模型,并将输入缩放作为 sci-kit learn Pipeline 中的预处理步骤。有什么办法可以避免缩放二进制列?发生的事情是这些列与其他列一起缩放,导致值以 0 为中心,而不是 0 或 1,所以我得到像 [-0.6, 0.3] 这样的值,这导致输入值为 0影响我的线性模型中的预测。

基本代码来说明:

我希望最后一行的输出是:

我有什么办法可以做到这一点?我想我可以只选择不是二进制的列,只转换这些列,然后将转换后的值替换回数组,但我希望它与 sci-kit 学习管道工作流很好地配合,所以我可以做类似的事情:

0 投票
1 回答
1272 浏览

python - How to obtain the eigenvalues after performing Multidimensional scaling?

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:

0 投票
1 回答
598 浏览

colors - Plotly in Shiny Problems

我的 Shiny 使用 plotly 呈现多维缩放结果时遇到了一些问题。下面是我的代码。我的任何问题的答案都会很棒,在此先感谢。

好吧,

a) 如何将动作按钮 (go) 'Plot Players' 进一步向下移动,使其不会被向下滚动列表阻止?

b) 我希望数据表能够适应用户的缩放。我可以让它为 plotly_click 工作(调整到用户的点击),但不适用于 plotly_relayout 或 plotly_zoom。或者尝试使用缩放点对表格中的点进行排序(即显示表格顶部的缩放点)而不是尝试让表格仅显示缩放点会是一个更简单的选择吗?

c)悬停文本是否可能与标记文本不同。即我想要: marker = "text", text = Initials hoverinfo = "text", text = paste ("", Player, "Country: " , Country )) 也许添加首字母的痕迹可能是一种选择?

d) 颜色矢量工作不正常。如果您选择同时绘制女孩和男孩,它会起作用。但是,如果您只选择女孩,例如当您选择颜色时,颜色不再是金色或蓝色。我想明确地说女孩(性别列='F')用金色绘制,男性用蓝色绘制。在这里,我为一个非情节情节做了它: player.col = rep("gold", nrow(playerData)) # 让所有 dat 行都涂成金色 male = which(playerData$Sex=="M") player. col[male] = "blue" # 将此行着色 = 'M' 蓝色 - 不是金色

如您所见,如果男孩和女孩没有被绘制在一起,颜色是粉红色的......

非常感谢

这是运行代码的数据:

0 投票
2 回答
1992 浏览

machine-learning - Why is `sklearn.manifold.MDS` random when `skbio's pcoa` is not?

I'm trying to figure out how to implement Principal Coordinate Analysis with various distance metrics. I stumbled across both skbio and sklearn with implementations. I don't understand why sklearn's implementation is different everytime while skbio is the same? Is there a degree of randomness to Multidimensional Scaling and in particular Principal Coordinate Analysis? I see that all of the clusters are very similar but why are they different? Am I implementing this correctly?

Running Principal Coordinate Analysis using Scikit-bio (i.e. Skbio) always gives the same results:

enter image description here

Now with sklearn's Multidimensional Scaling:

enter image description here

0 投票
1 回答
226 浏览

static - 居中矩阵与多维缩放的关系

我尝试了解多维缩放的步骤,并且该方法基于居中矩阵,我不明白他的确切作用是什么

0 投票
1 回答
122 浏览

r - 多维缩放

我正在尝试将 MDS 应用于基于分歧的距离矩阵(即它是“HSAUR”包中的“投票”数据集。)我试图将其减少到二维并在没有 cmdscale() 函数的情况下进行绘图,但是当我尝试自己做时无法得到相同的结果。这是代码;

我正在遵循标准教科书符号。这是我得到的数据矩阵Yhat

与来自 cmdscale() 的相比:

它们似乎相关,但我不明白是什么导致了不同的结果。我很乐意对代码进行更正。提前非常感谢。