Skip to content

Segfault from knn.cv in class package (PR#6856)

2 messages · James W. MacDonald, Brian Ripley

#
The function knn.cv in the class package doesn't have error checking to
ensure that the length of the classlabel argument is equal to the number
of rows in the test set. If the classlabel is short, the result is often
a segfault.
[1] 2 2 1 2 1 2 2 2 2 2
Levels: 1 2
This also occurs on my linux box.

Best,

Jim



--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 1
 minor = 9.0
 year = 2004
 month = 04
 day = 12
 language = R

Windows XP Professional (build 2600) Service Pack 1.0

Search Path:
 .GlobalEnv, package:methods, package:stats, package:graphics,
package:utils, Autoloads, package:base


James W. MacDonald
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623
#
This is user error.

R-bugs is not the appropriate place to report user error in a contributed 
package -- please do read the R FAQ.
On Wed, 5 May 2004 jmacdon@med.umich.edu wrote:

            
There is no *test* set in knn.cv, nor is there a `classlabel argument'.
There is 

      cl: factor of true classifications of training set 

and that has been specified incorrectly.