python机器学习、数据分析常用第三方库(实时更新)
常用鏡像源:
清華:https://pypi.tuna.tsinghua.edu.cn/simple
阿里:http://mirrors.aliyun.com/pypi/simple/
豆瓣:http://pypi.douban.com/simple/
華中理工大學:http://pypi.hustunique.com/
山東理工大學:http://pypi.sdutlinux.org/
中國科學技術大學:http://pypi.mirrors.ustc.edu.cn/
以豆瓣鏡像為例,使用如下命令安裝你想要的模塊:
pip install 模塊名 -i http://pypi.douban.com/simplepip升級到7.0以后,在使用http鏡像進行包安裝及升級的時候往往會有如下提示:
Collecting beautifulsoup4
The repository located at xxx.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with ‘–trusted-host xxx.com’.
這時候根據提示在最后添加–trusted-host + 鏡像官網即可。例如:
pip install 模塊名 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com決策樹可視需要安裝包和插件:pip install graphviz (還需要配置環境)
pip install graphviz
pip install pydotplus
pip install six
import graphviz
import pydotplus
from six import StringIO
為了解決export_graphviz畫決策樹圖時中文亂碼的問題,需要使用sklearn.externals.six包里的StringIO
查閱資料后發現sklearn 0.23版本已經刪掉了這個包。
因此直接安裝six包:
mysql第三方數據庫模塊
pip install pymysql
import pymysql
科學計算庫
pip install numpy
pip install pandas
數據缺失
pip install missingno
import missingno as msno
boosting集成學習
pip install xgboost
pip install lightgbm
import xgboost as xgb
import lightgbm as lgb
語音播放相關
playsound
機器學習深度學習框架
pip install tensorflow
pip install keras
pip3 install torch torchvision torchaudio
注意:安裝Pytorch最好進入官網根據自己的需求選擇合適的版本
官網:(https://pytorch.org/)
圖片相關
pip install scikit-image
結巴分詞
pip install jieba
畫圖
pip install matplotlib
關聯規則
pip install apyori
from apyori import apriori
不平衡樣本處理
pip install imbalanced-learn
pip install imblearn
使用SMOTE進行過采樣
from imblearn.over_sampling import SMOTE
注意:處理不平衡數據集,也可以先SMOTE過采樣,再進行下采樣
數理統計時間序列
pip install statsmodels
時間序列特征提取
pip install tsfresh
總結
以上是生活随笔為你收集整理的python机器学习、数据分析常用第三方库(实时更新)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 不怕贼偷,就怕贼惦记!
- 下一篇: Anaconda创建python虚拟环境