lvqinit.html

来自「本程序是基于linux系统下c++代码」· HTML 代码 · 共 114 行

HTML
114
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Initialize a LVQ Codebook</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>

<table width="100%" summary="page for lvqinit {class}"><tr><td>lvqinit {class}</td><td align="right">R Documentation</td></tr></table>
<h2>Initialize a LVQ Codebook</h2>


<h3>Description</h3>

<p>
Construct an initial codebook for LVQ methods.
</p>


<h3>Usage</h3>

<pre>
lvqinit(x, cl, size, prior, k = 5)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>x</code></td>
<td>
a matrix or data frame of training examples, <code>n</code> by <code>p</code>.
</td></tr>
<tr valign="top"><td><code>cl</code></td>
<td>
the classifications for the training examples. A vector or factor of
length <code>n</code>.
</td></tr>
<tr valign="top"><td><code>size</code></td>
<td>
the size of the codebook. Defaults to <code>min(round(0.4*ng*(ng-1 + p/2),0), n)</code>
where <code>ng</code> is the number of classes.
</td></tr>
<tr valign="top"><td><code>prior</code></td>
<td>
Probabilities to represent classes in the codebook. Default proportions in the
training set.
</td></tr>
<tr valign="top"><td><code>k</code></td>
<td>
k used for k-NN test of correct classification. Default is 5.
</td></tr>
</table>

<h3>Details</h3>

<p>
Selects <code>size</code> examples from the training set without replacement with
proportions proportional to the prior or the original proportions.
</p>


<h3>Value</h3>

<p>
A codebook, represented as a list with components <code>x</code> and <code>cl</code> giving
the examples and classes.</p>

<h3>References</h3>

<p>
Kohonen, T. (1990) The self-organizing map.
<EM>Proc. IEEE </EM>
<B>78</B>, 1464&ndash;1480.
</p>
<p>
Kohonen, T. (1995)
<EM>Self-Organizing Maps.</EM>
Springer, Berlin.
</p>
<p>
Ripley, B. D. (1996)
<EM>Pattern Recognition and Neural Networks.</EM> Cambridge.
</p>
<p>
Venables, W. N. and Ripley, B. D. (2002)
<EM>Modern Applied Statistics with S.</EM> Fourth edition.  Springer.
</p>


<h3>See Also</h3>

<p>
<code><a href="lvq1.html">lvq1</a></code>, <code><a href="lvq2.html">lvq2</a></code>, <code><a href="lvq3.html">lvq3</a></code>, <code><a href="olvq1.html">olvq1</a></code>, <code><a href="lvqtest.html">lvqtest</a></code>
</p>


<h3>Examples</h3>

<pre>
data(iris3)
train &lt;- rbind(iris3[1:25,,1], iris3[1:25,,2], iris3[1:25,,3])
test &lt;- rbind(iris3[26:50,,1], iris3[26:50,,2], iris3[26:50,,3])
cl &lt;- factor(c(rep("s",25), rep("c",25), rep("v",25)))
cd &lt;- lvqinit(train, cl, 10)
lvqtest(cd, train)
cd1 &lt;- olvq1(train, cl, cd)
lvqtest(cd1, train)
</pre>



<hr><div align="center">[Package <em>class</em> version 7.2-44 <a href="00Index.html">Index]</a></div>

</body></html>

⌨️ 快捷键说明

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