EVOLUTION-MANAGER
Edit File: lvqinit.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Initialize a LVQ Codebook</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <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 style="text-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> <p>a matrix or data frame of training examples, <code>n</code> by <code>p</code>. </p> </td></tr> <tr valign="top"><td><code>cl</code></td> <td> <p>the classifications for the training examples. A vector or factor of length <code>n</code>. </p> </td></tr> <tr valign="top"><td><code>size</code></td> <td> <p>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. </p> </td></tr> <tr valign="top"><td><code>prior</code></td> <td> <p>Probabilities to represent classes in the codebook. Default proportions in the training set. </p> </td></tr> <tr valign="top"><td><code>k</code></td> <td> <p>k used for k-NN test of correct classification. Default is 5. </p> </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–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> train <- rbind(iris3[1:25,,1], iris3[1:25,,2], iris3[1:25,,3]) test <- rbind(iris3[26:50,,1], iris3[26:50,,2], iris3[26:50,,3]) cl <- factor(c(rep("s",25), rep("c",25), rep("v",25))) cd <- lvqinit(train, cl, 10) lvqtest(cd, train) cd1 <- olvq1(train, cl, cd) lvqtest(cd1, train) </pre> <hr /><div style="text-align: center;">[Package <em>class</em> version 7.3-15 <a href="00Index.html">Index</a>]</div> </body></html>