Scikit-learn 教程文档位置

Scikit-learn tutorial documentation location

我在 Ubuntu 14.04 上安装了 scikit-learn 0.16.1,并且正在学习本教程。 SKL 已安装所有默认配置。教程指出

The source of this tutorial can be found within your scikit-learn folder: scikit-learn/doc/tutorial/text_analytics/

我在整个驱动器上使用了 find,但没有 "tutorial" 文件夹。没有任何地方。有人知道这些文件的实际安装位​​置吗?

正在查找包裹内容

包的安装位置取决于您安装 scikit-learn 的方式

  • 如果您通过

    使用了Ubuntu的包系统
    sudo apt-get install python-sklearn python-sklearn-doc
    

    (你经常需要doc包来获取随附的文档),那么教程就少了。 doc/-文件夹不包含在python-sklearn-doc-包中。参见 bug report.

    您可以通过

    查看包裹内容
    dpkg-query --listfiles python-sklearn-doc
    
  • 如果你用过the Python Package Index to install it via

    pip install --user --install-option="--prefix=" -U scikit-learn
    

    ,那么安装应该在$HOME/.local/lib/python2.7/site-packages/sklearn。 (和 pip show -f scikit-learn 一样)但是

    find . | grep -i tutorial
    

    没有找到任何 tutorial/ 文件夹。

  • 如果您是从源安装的,请考虑通过 pip 重新安装,因为 the warning states that

Warning

Packages installed with the python setup.py install command cannot be uninstalled nor upgraded by pip later. To properly uninstall scikit-learn in that case it is necessary to delete the sklearn folder from your Python site-packages directory.

解决方案

一个解决方案是使用源代码。下载 master file 或通过 git:

    git clone https://github.com/scikit-learn/scikit-learn.git

git 存档超过 60 MiB,因此您可能更喜欢 master zip