Looking at the documentation: 
https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KernelDensity.html
 
<https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KernelDensity.html>

The public import is: `from sklearn.neighbors import KernelDensity` omitting 
the kde.

Cheers,
--
Guillaume Lemaitre
Scikit-learn @ Inria Foundation
https://glemaitre.github.io/

> On 24 Jan 2022, at 10:41, Mahmood Naderan <mahmood...@gmail.com> wrote:
> 
> Hi,
> I have installed scikit 1.0.2 version via pip as below
> 
> $ pip3 install --user sklearn
> Collecting sklearn
>   Downloading sklearn-0.0.tar.gz (1.1 kB)
> Collecting scikit-learn
>   Downloading 
> scikit_learn-1.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 
> (26.7 MB)
>      |████████████████████████████████| 26.7 MB 10.5 MB/s 
> Requirement already satisfied: scipy>=1.1.0 in 
> ./.local/lib/python3.8/site-packages (from scikit-learn->sklearn) (1.6.0)
> Collecting joblib>=0.11
>   Using cached joblib-1.1.0-py2.py3-none-any.whl (306 kB)
> Requirement already satisfied: numpy>=1.14.6 in 
> ./.local/lib/python3.8/site-packages (from scikit-learn->sklearn) (1.20.2)
> Collecting threadpoolctl>=2.0.0
>   Using cached threadpoolctl-3.0.0-py3-none-any.whl (14 kB)
> Building wheels for collected packages: sklearn
>   Building wheel for sklearn (setup.py) ... done
>   Created wheel for sklearn: filename=sklearn-0.0-py2.py3-none-any.whl 
> size=1316 
> sha256=8bcf6cce0190ae1dcf2af1315bc71b09a162362ec91e063cdc027b4ec55b5ff1
>   Stored in directory: 
> /home//.cache/pip/wheels/22/0b/40/fd3f795caaa1fb4c6cb738bc1f56100be1e57da95849bfc897
> Successfully built sklearn
> Installing collected packages: threadpoolctl, joblib, scikit-learn, sklearn
> Successfully installed joblib-1.1.0 scikit-learn-1.0.2 sklearn-0.0 
> threadpoolctl-3.0.0
> 
> 
> However, I get the following error when I want to use KernelDensity
> 
>     from sklearn.neighbors.kde import KernelDensity
> ModuleNotFoundError: No module named 'sklearn.neighbors.kde'
> 
> 
> Any idea how to fix that?
> 
> Regards,
> Mahmood
> 
> 
> _______________________________________________
> scikit-learn mailing list
> scikit-learn@python.org
> https://mail.python.org/mailman/listinfo/scikit-learn

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

Reply via email to