MultivariateStats.jl
MultivariateStats.jl copied to clipboard
KernelPCA reconstruct problem
I try using KernelPCA to transform and reconstruct the data, but original data and reconstruct data is not approx.
using Plots,MultivariateStats
x = rand(10,100)
m = fit(KernelPCA,x;inverse =true
y=reconstruct(m, predict(m, x))
plot([x[1,:] y[1,:])
how to make the reconstruct data approximate the origin data
Kernel PCA reconstructions is always approximate, especially out-of-sample, as it generally requires solving a quadratic optimization problem. So, the reconstruction will be always off with respect to the original data. The package uses a heuristic for an approximate reconstruction, i.e. quadratic optimization, which produces even worst approximation. See https://github.com/JuliaStats/MultivariateStats.jl/issues/125 for references.