Compute scores for all point used to train KernelDensity

25 Views Asked by At

I use KernelDensity from sklearn to estimate probability density of a list with 1D elements. After training de kde model I need to compute scores for all points used for the training; because I have a lot of values (around 200k) to score_samples is very slow - can I speed up this process somehow? I mean without parallel implementation or similar stuff. Again, I want score for values used to train the model - I am missing something? isn't there a method in KernelDensity to do this (for the training points)?

My initial goal was to find / estimate somehow the probability distribution starting from a collection of values (1d values, i.e scalars), then when a new value come to compute his probability. But I also need to compute probabilities for all training data. Also, I know that predict function does not compute probability itself, but log-likelihood, but this is not really a problem, I can use something like sigmoid function to map from R to (0, 1)

0

There are 0 best solutions below