EVOLUTION-MANAGER
Edit File: condense.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: Condense training set for k-NN classifier</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 condense {class}"><tr><td>condense {class}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Condense training set for k-NN classifier </h2> <h3>Description</h3> <p>Condense training set for k-NN classifier </p> <h3>Usage</h3> <pre> condense(train, class, store, trace = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>train</code></td> <td> <p>matrix for training set </p> </td></tr> <tr valign="top"><td><code>class</code></td> <td> <p>vector of classifications for test set </p> </td></tr> <tr valign="top"><td><code>store</code></td> <td> <p>initial store set. Default one randomly chosen element of the set. </p> </td></tr> <tr valign="top"><td><code>trace</code></td> <td> <p>logical. Trace iterations? </p> </td></tr></table> <h3>Details</h3> <p>The store set is used to 1-NN classify the rest, and misclassified patterns are added to the store set. The whole set is checked until no additions occur. </p> <h3>Value</h3> <p>Index vector of cases to be retained (the final store set). </p> <h3>References</h3> <p>P. A. Devijver and J. Kittler (1982) <em>Pattern Recognition. A Statistical Approach.</em> Prentice-Hall, pp. 119–121. </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="reduce.nn.html">reduce.nn</a></code>, <code><a href="multiedit.html">multiedit</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))) keep <- condense(train, cl) knn(train[keep, , drop=FALSE], test, cl[keep]) keep2 <- reduce.nn(train, keep, cl) knn(train[keep2, , drop=FALSE], test, cl[keep2]) </pre> <hr /><div style="text-align: center;">[Package <em>class</em> version 7.3-15 <a href="00Index.html">Index</a>]</div> </body></html>