Hi,
I would like to use KernelDensity for some vectors. If the length of
vectors is greater than 2, there is no problem.
However, for the following example, it seems that the density
estimation doesn't work properly.

v = [2.46415e+07,1.23208e+07]
a = array(v).reshape(-1, 1)
kde = KernelDensity(kernel='gaussian', bandwidth=1).fit(a)
s = linspace(min(a),max(a))
e = kde.score_samples(s.reshape(-1,1))
plot(s, e)
mi = argrelextrema(e, np.less)[0]
print ("Minima:", s[mi])


The s[mi] is empty in the end. But indeed the plot shows a minima
because there is a gap between two numbers.
Is there any restriction or note about using KernelDensity?

Regards,
Mahmood
_______________________________________________
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn

Reply via email to