minor
This commit is contained in:
parent
d3639fe2ef
commit
472b35e38c
@ -32,8 +32,10 @@ function()
|
|||||||
dat <- dat[,!(colnames(dat) %in% c('ocean_proximity'))]
|
dat <- dat[,!(colnames(dat) %in% c('ocean_proximity'))]
|
||||||
|
|
||||||
dat.all <- dat
|
dat.all <- dat
|
||||||
dat <- list(X = dat[,!(colnames(dat) %in% c('median_house_value'))],
|
X <- dat[,!(colnames(dat) %in% c('median_house_value'))]
|
||||||
Y = dat[,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)
|
split <- splitdata(dat, 0.8)
|
||||||
entr <- split$entr
|
entr <- split$entr
|
||||||
test <- split$test
|
test <- split$test
|
||||||
@ -104,3 +106,6 @@ landmarks <- landmarks.by.ca.clst(hous.cam, X.entr, nb.landmarks)
|
|||||||
nakrm <- kfold.nakr(X.entr, Y.entr, landmarks=landmarks)
|
nakrm <- kfold.nakr(X.entr, Y.entr, landmarks=landmarks)
|
||||||
nakrm.yh <- predict(nakrm, X.test)
|
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]])
|
2
pad.R
2
pad.R
@ -2,6 +2,8 @@
|
|||||||
# rm(list=ls())
|
# rm(list=ls())
|
||||||
# bookdown::render_book()
|
# bookdown::render_book()
|
||||||
# :/^\#
|
# :/^\#
|
||||||
|
# save.image(file="~/tmp/202301231942.Rdata")
|
||||||
|
# load(file = "~/tmp/202301231942.Rdata")
|
||||||
|
|
||||||
# bash make_chapter 19_nystroem_approximation.Rmd
|
# bash make_chapter 19_nystroem_approximation.Rmd
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user