There are some bugs in the script KLIEP.R. One is that in this sentence if(verbose) message("Searching optimal sigma and lambda...") we only optimize sigma without lambda. A serious one is in the function compute_density_ratio, this function use the train set to predict the density ratio of a new sample, which results in the mismarch of the dimension of the predicted value and the new sample.
There are some bugs in the script KLIEP.R. One is that in this sentence
if(verbose) message("Searching optimal sigma and lambda...")we only optimize sigma without lambda. A serious one is in the functioncompute_density_ratio, this function use the train set to predict the density ratio of a new sample, which results in the mismarch of the dimension of the predicted value and the new sample.