python sklearn包的安装

sklearn的安装包名为scikit-learn,import包时的包名还是sklearn

安装命令

pip3 install scikit-learn

如果遇到Failed to establish a new connection报错,则先修改pip源,命令如下:

#临时修改源
pip3 install 包名 -i https://pypi.tuna.tsinghua.edu.cn/simple

#永久修改源
pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

配置文件的修改方法

配置文件路径~/.config/pip/pip.conf~为home路径,没有该文件或路径则新建即可

vim pip.conf
#键入i,输入以下内容
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host = mirrors.aliyun.com
:x  #保存退出

常用的国内源:

清华大学源:https://pypi.tuna.tsinghua.edu.cn/simple
腾讯源:http://mirrors.cloud.tencent.com/pypi/simple
阿里源:https://mirrors.aliyun.com/pypi/simple/
豆瓣源 :http://pypi.douban.com/simple/

机器学习其他常用包

  • numpy: 数据封装工具,包含数组、标量、向量、矩阵等常用数据封装、及其访问和运算。
  • scipy: 用于科学计算的工具,比如微积分、插值、傅里叶变换、矩阵等。
  • Matplot:用于展示数据的工具,包含散点图、组合图、图像等的基本绘制方法。
posted @ 2024-04-12 15:37  HL棣  阅读(97)  评论(0编辑  收藏  举报