⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 som_read_data.html

📁 Kohonen的SOM软件包
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><html><head><title>SOM Toolbox / som_read_data </title></head><body bgcolor=#f0f0f0><table border=0 width="100%" cellpadding=0 cellspacing=0><tr><td valign=baseline><font size=+2>SOM Toolbox</font></td><td valign=baseline align=center><a href="somtoolbox.html">Online documentation</td><td valign=baseline align=right><a href="http://www.cis.hut.fi/projects/somtoolbox/" target="_top">http://www.cis.hut.fi/projects/somtoolbox/</a></td></tr></table><hr><H1> som_read_data </H1><H3> Purpose </H3><PRE> Reads data from an ascii file in SOM_PAK format.</PRE><H3> Syntax </H3><UL><PRE>  sD = som_read_data(filename)  sD = som_read_data(..., dim)  sD = som_read_data(..., 'missing')  sD = som_read_data(..., dim, 'missing')</PRE></UL><H3> Description </H3><PRE> This function is offered for compatibility with SOM_PAK, a SOM software package in C. It reads data from a file in SOM_PAK format. The SOM_PAK data file format is as follows. The first line must contain the input space dimension and nothing else. The following lines are comment lines, empty lines or data lines. Unlike programs in SOM_PAK, this function can also determine the input dimension from the first data lines, if the input space dimension line is missing.  Note that the SOM_PAK format is not fully supported: data vector 'weight' and 'fixed' properties are ignored (they are treated as labels). Each data line contains one data vector and its labels. From the beginning of the line, first are values of the vector components separated by whitespaces, then labels also separated by whitespaces. If there are missing values in the vector, the missing value marker needs to be specified as the last input argument ('NaN' by default). The missing values are stored as NaNs in the data struct.  Comment lines start with '#'. Comment lines as well as empty lines are ignored, except if the comment lines that start with '#n' or '#l'. In that case the line should contain names of the vector components or label names separated by whitespaces. NOTE: The minimum value Matlab is able to deal with (realmax) should not appear in the input file. This is because function sscanf is not able to read NaNs: the NaNs are in the read phase converted to value realmax.</PRE><H3> Required input arguments </H3><PRE>  filename    (string) input filename</PRE><H3> Optional input arguments </H3><PRE>  dim         (scalar) input space dimension  missing     (string) string used to denote missing components (NaNs);                        default is 'NaN'</PRE><H3> Output arguments </H3><PRE>  sD   (struct) the resulting data struct</PRE><H3> Examples </H3><PRE> The basic usage is:  sD = som_read_data('system.data'); If you know the input space dimension beforehand, and the file does not contain it on the first line, it helps if you specify it as the second argument:   sD = som_read_data('system.data',9); If the missing components in the data are marked with some other characters than with 'NaN', you can specify it with the last argument:   sD = som_read_data('system.data',9,'*')  sD = som_read_data('system.data','NaN') Here's an example data file: 5 #n one two three four five #l ID 10 2 3 4 5 1stline label 0.4 0.3 0.2 0.5 0.1 2ndline label1 label2 # comment line: missing components are indicated by 'x':s 1 x 1 x 1 3rdline missing_components x 1 2 2 2  x x x x x 5thline emptyline</PRE><H3> See also </H3><TABLE NOBORDER WIDTH=80%><TR><TD><a href="som_write_data.html"><B>som_write_data</B></a><TD> Writes data structs/matrices to a file in SOM_PAK format.<TR><TD><a href="som_read_cod.html"><B>som_read_cod</B></a><TD> Read a map from a file in SOM_PAK format.<TR><TD><a href="som_write_cod.html"><B>som_write_cod</B></a><TD> Writes data struct into a file in SOM_PAK format.<TR><TD><a href="som_data_struct.html"><B>som_data_struct</B></a><TD> Creates data structs.</TABLE><p><hr><br><br><!-- Last updated: May 30 2002 --></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -