minor
This commit is contained in:
parent
d3639fe2ef
commit
472b35e38c
@ -32,8 +32,10 @@ function()
|
||||
dat <- dat[,!(colnames(dat) %in% c('ocean_proximity'))]
|
||||
|
||||
dat.all <- dat
|
||||
dat <- list(X = dat[,!(colnames(dat) %in% c('median_house_value'))],
|
||||
Y = dat[,c('median_house_value')])
|
||||
X <- dat[,!(colnames(dat) %in% c('median_house_value'))]
|
||||
Y <- dat[,c('median_house_value')]
|
||||
names(Y) <- rownames(X)
|
||||
dat <- list(X = X, Y = Y)
|
||||
split <- splitdata(dat, 0.8)
|
||||
entr <- split$entr
|
||||
test <- split$test
|
||||
@ -103,4 +105,7 @@ nb.landmarks <- round(sqrt(nrow(X.entr)))
|
||||
landmarks <- landmarks.by.ca.clst(hous.cam, X.entr, nb.landmarks)
|
||||
nakrm <- kfold.nakr(X.entr, Y.entr, landmarks=landmarks)
|
||||
nakrm.yh <- predict(nakrm, X.test)
|
||||
nakrm.mae <- mean(abs(nakrm.yh - Y.test))
|
||||
nakrm.mae <- mean(abs(nakrm.yh - Y.test))
|
||||
# nakrm.yh.train <- predict(nakrm, X.entr)
|
||||
# rev(order(abs(nakrm.yh.train - Y.entr)))[1:20]
|
||||
# hist(Y.entr[rev(order(abs(nakrm.yh.train - Y.entr)))[1:200]])
|
Loading…
Reference in New Issue
Block a user