- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有一个包含数据的文本文件。我的文本文件:
young, myopic, no, reduced, no
young, myopic, no, normal, soft
young, myopic, yes, reduced, no
young, myopic, yes, normal, hard
young, hyperopia, no, reduced, no
young, hyperopia, no, normal, soft
young, hyperopia, yes, reduced, no
young, hyperopia, yes, normal, hard
阅读我的文本文件加载方法
%young=1
%myopic=2
%no=3 etc.
load iris.txt
net = newsom(1,[1 5]);
[net,tr] = train(net,1);
plotsomplanes(net);
错误代码:
??? Undefined function or method 'plotsomplanes' for input arguments of type 'network'.
最佳答案
鉴于您显示的文本文件,LOAD 函数将不起作用。你应该使用 TEXTSCAN解析文本文件。然后我使用 GRP2IDX将标称数据转换为数字属性(它将为每个属性值分配 1,2,3,..)。在这种情况下,数据变为:
>> data =
1 1 1 1 1
1 1 1 2 2
1 1 2 1 1
1 1 2 2 3
1 2 1 1 1
1 2 1 2 2
1 2 2 1 1
1 2 2 2 3
>> labels{:}
ans =
'young'
ans =
'myopic'
'hyperopia'
ans =
'no'
'yes'
ans =
'reduced'
'normal'
ans =
'no'
'soft'
'hard'
我应该提一下,您可能需要更大的数据集(更多实例)才能获得任何有意义的结果...
%# read text file
fid = fopen('iris.txt');
D = textscan(fid, '%s %s %s %s %s', 'Delimiter',',');
fclose(fid);
%# convert nominal to numeric
%#data = cell2mat( cellfun(@grp2idx, D, 'UniformOutput',false) );
data = zeros(numel(D{1}),numel(D));
labels = cell(size(D));
for i=1:numel(D)
[data(:,i) labels{i}] = grp2idx(D{i});
end
%# build SOM
net = newsom(data', [4 4]);
[net,tr] = train(net, data');
figure, plotsomhits(net, data')
figure, plotsomplanes(net)
关于matlab - MATLAB 中的自组织映射 (SOM) 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4578473/
过去几个月我一直在研究自组织映射(SOM)。但是我在理解降维部分仍然有些困惑。你能提出任何简单的方法来理解 SOM 在任何现实世界数据集上的实际工作吗(就像来自 UCI 存储库的数据集一样)。 最佳答
我想知道如何使用 K-Means 对 SOM 神经元进行聚类。 假设我有一个形状为 (1024 x 10) 的原始数据神经元数量为 400 (20 x 20)U 矩阵的形状为 (20 x 20)如何使
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 9 年前。 Improve this ques
我想看看 SOM 算法是否可以用于分类预测。我曾经在下面编写代码,但我发现分类结果远非正确。例如,在测试数据集中,我得到的不仅仅是训练目标变量中的 3 个值。如何创建与训练目标变量对齐的预测模型? l
我和我的 friend 决定在 python 中做一个关于推荐引擎的项目。最初我们决定使用 SVM 做我们的项目,但很快发现它的监督学习很困难,现在我们计划使用自组织 map 并可能将它与协作过滤(不
我是聚类和神经网络方面的新手,我刚刚开始使用自组织映射 (SOM) 来执行一些聚类。我有一个 15 维数据集,我用下一个代码创建了一个 som: size = 20 from minisom impo
我有 71 个属性和 17 个实例的数据。我想将它们分为六组或六类。我尝试使用 newsom( data, [ 6 6 ] )。 结果如下图所示。我不知道集群的位置以及如何以编程方式找到它们? 我阅读
我正在尝试根据 body 部位之间的角度对一些图像进行聚类。 从每张图片中提取的特征是: angle1 : torso - torso angle2 : torso - upper left arm
我正在寻找基于 C、C++ 或 Java 的 SOM 实现,并具有适用于商业用途的许可(非零成本是可以的)。 到目前为止,我知道存在 SOM_PAK(来自 Kohonen),但许可禁止商业用途。 有人
有人知道或拥有 Mathematica 中 SOM 的合理实现吗? 最佳答案 有一个名为 machine learning framework 的第三方 Mathematica 软件包,它实现了自组织
我正在使用 SOM Toolbox分析从汽车数据库收集的数据。我的问题是在可视化统一距离矩阵时。引用 som_umat 的文档: Compute and return the unified dist
我一直在网上搜索并试图理解我所拥有的文献,但有些东西却让我困惑。 给定一个 SOM,当用 U 矩阵可视化时,U 矩阵是否表示给定节点与每个其他节点之间的距离,或者节点与其直接邻居之间的距离? 问候,
SOM - 自组织映射,每个输入维度映射到所有输出节点,节点相互竞争评分 - 矢量量化。 PCA 和其他聚类方法可以看作是该过程的简化特例。 SOM 中只有一个获胜节点。然而,当输入与两个已建立的“集
通常学习率是我们在开始时决定的值,并且通常不会随着迭代次数而改变。但是在SOM中学习率是随着迭代而改变的,这背后的想法是什么? 据我了解,学习率应该随着迭代次数的增加而降低。这是为什么? 最佳答案 原
我有一个包含数据的文本文件。我的文本文件: young, myopic, no, reduced, no young, myopic, no, normal, soft young, myopic,
训练 SOM 后,如何将新数据绘制到 SOM 上并可视化它如何映射到 SOM 上?理想情况下,我希望用相应的分类颜色和节点位置绘制它。 identify() 具有根据 SOM map 上的选择精确定位
有人可以提供一些关于如何将自组织 map 与多层感知器正确结合的信息吗? 我最近阅读了一些关于这项技术与常规 MLP 相比的文章,它在预测任务中的表现要好得多。因此,我想通过对输入数据进行聚类并将结果
我也在做一个需要时间序列数据聚类的项目。我正在使用在 MATLAB 中工作的 SOM 工具箱进行聚类,但遇到以下问题:“我们如何确定哪些数据属于哪个集群?” SOM 从数据集中随机选择数据样本,并为每
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 6年前关闭。 Improve thi
我目前正在学习我自己的自组织 map (SOM)。我是新来的。节点全部用随机值初始化。我想知道,如果训练期间出现返回多个BMU的情况,我该怎么办?对于更新阶段,我需要只获取其中一项,还是全部? 最佳答
我是一名优秀的程序员,十分优秀!