我在 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至 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 .
关于python - Scikit-learn 教程文档位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32183129/