2012-04-25 46 views
1

我在.txt文件中具有以下格式的数据。绘制d维数据

नोभेम्बर 
[0.013597779962868256, -0.10849757437254635, -0.15999846585159766, -1.2417475384869558, -0.6802765400695919, 0.44552601044477186, 0.10820787964125786, -1.584483680411645, 0.2007759414522207, -0.7101547556233192] 
बाट 
[0.7488351202673913, 0.3645634610332536, 0.1937027124201285, -0.10361011958447905, 0.48222626651261347, 0.36795608937720814, -0.06307932558713457, -0.05626217864435294, -0.5245206209054951, 0.40256760017279525] 
रूपमा 
[0.06077674960453302, 0.2570556052636379, 0.3347552495487344, -0.10512580657948888, 0.10414134700640766, 0.19736087970834254, 0.09207914995816116, 0.19904934221006, 0.061402311347008, -0.11409541813280075] 
बोर्डमा 
[0.5200111891848155, -0.14947230042320633, 0.7351562111464331, -0.7542450932215059, 1.4477558941048831, -0.6235133303135835, -0.7781689512584442, -0.057886889872348815, 0.10625424653444066, 0.9777761194886687] 
आउनु 
[1.0596966006985387, 0.24909505933749815, 0.5181999691383957, -0.01983089009044503, -1.4106664226234644, -0.020542297788816014, -0.7822719255911348, 0.42914674116391344, -0.5753257725556651, -0.9141151600890186] 

这个词是像 नोभेम्बर是数据点和数值是它们的矢量表示。我想以这些表示法作为统筹并绘制它们以便找出它们之间的关系。什么是可能性来绘制them.Any建议的工具真的很感激。

+2

一些可能的解决方案在这里:http://stackoverflow.com/a/6775352/636656 – 2012-04-25 12:31:25

+0

为什么这有这么多标签?您是否想要在任何或所有这些软件包中提供解决方案?为什么不使用python,ruby,C或fortran? – Spacedman 2012-04-25 13:17:07

+0

我想从任何这些解决方案。我对这些工作感到很自在。其他领域的解决方案也受到欢迎。 – thetna 2012-04-25 13:34:21

回答

2

我的GUI无法处理该字体的项目名称,但如果我他们的名字:A,B,CC,d,E,可以使用平行坐标图来显示多维特点:

require(MASS) # an R package 
parcoord(data.frame(a=a,b=b,cc=cc,d=d,e=e), col=1:5) 

enter image description here

+0

如果我没有弄错,我认为OP意味着它是相反的:每个10维的5个实例(因为在你需要转置矩阵) – Amro 2012-04-25 21:51:38

+0

很可能。我无法从描述中看出来。我很感谢提问者。我已经将它用于今天的研究问题。 – 2012-04-25 22:04:26

1

这是一个MATLAB解决方案。

首先我们读取数据。虽然MATLAB是能够读取Unicode文本,它有some issues displaying it in GUI使用parallel coordinates(所以我只是用点1 /点2更换标签,等等。)

%# read file lines 
fid = fopen('data.txt', 'rt', 'native', 'UTF-8'); 
C = textscan(fid, '%s', 'Delimiter','\n'); 
fclose(fid); 
C = C{1}; 

%# split into labels/data 
labels = C(1:2:end); 
data = cellfun(@str2num, C(2:2:end), 'UniformOutput',false); 
data = cell2mat(data); 

%# HACK: MATLAB has issues displaying unicode text 
labels = num2str((1:size(data,1))', 'Point %d'); 

接下来我们就可以绘制数据:

%# you might need to normalize the attributes 
%#data = zscore(data); 

plot(data');   %'# plot lines 
set(gca, 'XTick',1:numDim, 'XGrid','on') 
xlabel('Features'), ylabel('Feature value') 
title('Parallel Coordinates') 
legend(labels)   %# show legend of labels 

parallel coordinates

如果你有机会获得统计工具箱,你可以使用visualize multivariate data许多技术:

%# parallel coordinates (similar the above) 
parallelcoords(data, 'Group',labels) 

%# glyph plot (stars) 
glyphplot(data, 'obslabels',labels, 'glyph','star') 

glyphplot_star

%# glyph plot (Chernoff faces) 
glyphplot(data, 'obslabels',labels, 'glyph','face') 

glyphplot_face

%# Andrews curves 
andrewsplot(data, 'Group',labels) 

andrewsplot