mirror of
https://github.com/andre-wojtowicz/uci-ml-to-r.git
synced 2024-11-26 16:15:29 +01:00
18 lines
764 B
R
18 lines
764 B
R
|
preprocessDataset = function()
|
||
|
{
|
||
|
csv.file = "wdbc.data"
|
||
|
|
||
|
dataset = read.csv(paste0(orig.dir, "/", csv.file), header=FALSE)
|
||
|
|
||
|
colnames(dataset) = c("id", "diagnosis",
|
||
|
apply(expand.grid(c("radius", "texture", "perimeter",
|
||
|
"area", "smoothness", "compactness",
|
||
|
"concavity", "concave points",
|
||
|
"symmetry", "fractal dimension"),
|
||
|
c("mean", "se", "worst")),
|
||
|
1, function(x){paste(x[2], x[1])}))
|
||
|
|
||
|
dataset = dataset %>% select(`mean radius`:`worst fractal dimension`, diagnosis)
|
||
|
|
||
|
return(dataset)
|
||
|
}
|