EVOLUTION-MANAGER
Edit File: multiedit.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: Multiedit 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 multiedit {class}"><tr><td>multiedit {class}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Multiedit for k-NN Classifier </h2> <h3>Description</h3> <p>Multiedit for k-NN classifier </p> <h3>Usage</h3> <pre> multiedit(x, class, k = 1, V = 3, I = 5, trace = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>matrix of training set. </p> </td></tr> <tr valign="top"><td><code>class</code></td> <td> <p>vector of classification of training set. </p> </td></tr> <tr valign="top"><td><code>k</code></td> <td> <p>number of neighbours used in k-NN. </p> </td></tr> <tr valign="top"><td><code>V</code></td> <td> <p>divide training set into V parts. </p> </td></tr> <tr valign="top"><td><code>I</code></td> <td> <p>number of null passes before quitting. </p> </td></tr> <tr valign="top"><td><code>trace</code></td> <td> <p>logical for statistics at each pass. </p> </td></tr></table> <h3>Value</h3> <p>Index vector of cases to be retained. </p> <h3>References</h3> <p>P. A. Devijver and J. Kittler (1982) <em>Pattern Recognition. A Statistical Approach.</em> Prentice-Hall, p. 115. </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="condense.html">condense</a></code>, <code><a href="reduce.nn.html">reduce.nn</a></code> </p> <h3>Examples</h3> <pre> tr <- sample(1:50, 25) train <- rbind(iris3[tr,,1], iris3[tr,,2], iris3[tr,,3]) test <- rbind(iris3[-tr,,1], iris3[-tr,,2], iris3[-tr,,3]) cl <- factor(c(rep(1,25),rep(2,25), rep(3,25)), labels=c("s", "c", "v")) table(cl, knn(train, test, cl, 3)) ind1 <- multiedit(train, cl, 3) length(ind1) table(cl, knn(train[ind1, , drop=FALSE], test, cl[ind1], 1)) ntrain <- train[ind1,]; ncl <- cl[ind1] ind2 <- condense(ntrain, ncl) length(ind2) table(cl, knn(ntrain[ind2, , drop=FALSE], test, ncl[ind2], 1)) </pre> <hr /><div style="text-align: center;">[Package <em>class</em> version 7.3-15 <a href="00Index.html">Index</a>]</div> </body></html>