Closed gdkrmr closed 7 years ago
Include something like this and add some parameters to inverse(...)
inverse(...)
library(dimRed) x <- loadDataSet("Iris") ir.drr <- embed(ir, "DRR", ndim = ndims(x)) ir.pca <- embed(ir, "PCA", ndim = ndims(x)) get_rmse_by_ndim <- function (x, n = ndims(x)) { res <- numeric(n) org <- getData(getOrgData(x)) for (i in seq_len(n)) { rec <- getData(inverse(x, getData(getDimRedData(x))[, seq_len(i), drop = FALSE])) res[i] <- sqrt(mean((org - rec) ^ 2)) } res } rmse <- data.frame( rmse_drr = get_rmse_by_ndim(ir.drr), rmse_pca = get_rmse_by_ndim(ir.pca) ) matplot(rmse, type = "l") plot(ir) plot(ir.drr) plot(ir.pca)
implemented as reconstruction_error
reconstruction_error
Include something like this and add some parameters to
inverse(...)