Linux 系统中 scikit-learn 编程环境

来源:互联网 发布:js 视频播放插件 编辑:程序博客网 时间:2024/06/03 18:20

Linux 系统中 scikit-learn 编程环境

1. Installing scikit-learn

Scikit-learn requires:

  • Python (>= 2.7 or >= 3.3),
  • NumPy (>= 1.8.2),
  • SciPy (>= 0.13.3).

If you already have a working installation of numpy and scipy,the easiest way to install scikit-learn is usingpip


pip install -U scikit-learn

or conda:

conda install scikit-learn


If you have not installed NumPy or SciPy yet, you can also install these usingconda or pip. When using pip, please ensure thatbinary wheels are used,and NumPy and SciPy are not recompiled from source, which can happen when usingparticular configurations of operating system and hardware (such as Linux ona Raspberry Pi).Building numpy and scipy from source can be complex (especially on Windows) andrequires careful configuration to ensure that they link against an optimizedimplementation of linear algebra routines.Instead, use a third-party distribution as described below.

If you must install scikit-learn and its dependencies with pip, you can installit asscikit-learn[alldeps]. The most common use case for this is in arequirements.txt file used as part of an automated build process for a PaaSapplication or a Docker image. This option is not intended for manualinstallation from the command line.


strong@foreverstrong:~$ pip install -U scikit-learnCollecting scikit-learn  Downloading scikit_learn-0.19.1-cp27-cp27mu-manylinux1_x86_64.whl (12.2MB)    100% |████████████████████████████████| 12.2MB 172kB/s Installing collected packages: scikit-learnSuccessfully installed scikit-learn-0.19.1You are using pip version 8.1.1, however version 9.0.1 is available.You should consider upgrading via the 'pip install --upgrade pip' command.


2. scikit-learn 版本

strong@foreverstrong:~$ pythonPython 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import sklearn>>> sklearn.__version__'0.19.1'>>> print(sklearn.__version__)0.19.1>>> exit()strong@foreverstrong:~$ 

3.

原创粉丝点击