Python機器學習庫

jopen 8年前發布 | 64K 次閱讀 機器學習

    Python在數據研究、數據分析和數據處理領域有獨特的地位,有大量的庫可以使用并批量執行。近年來,Python也得到機器學習研究者的青睞,很多機器學習的算法庫加入到了Python生態圈。這里介紹一些在發展的相關軟件庫,可以按圖索驥,一窺機器學習的端奧。最近,像Google/IBM/MS都加入了機器學習的大陣營,很多也提供了Python接口,值得學習。此外,大數據分析方法與機器學習、人工智能也是千絲萬縷的聯系,值得關注。

   Python 在科學計算領域,有兩個重要的擴展模塊:Numpy和Scipy。其中Numpy是一個用python實現的科學計算包。包括:

  • 一個強大的N維數組對象Array;

  • 比較成熟的(廣播)函數庫;

  • 用于整合C/C++和Fortran代碼的工具包;

  • 實用的線性代數、傅里葉變換和隨機數生成函數。

     SciPy是一個開源的Python算法庫和數學工具包,SciPy包含的模塊有最優化、線性代數、積分、插值、特殊函數、快速傅里葉變換、信號處理和圖像處理、常微分方程求解和其他科學與工程中常用的計算。其功能與軟件MATLAB、Scilab和GNU Octave類似。

    Numpy和Scipy常常結合著使用,Python大多數機器學習庫都依賴于這兩個模塊,繪圖和可視化依賴于matplotlib模塊,matplotlib的風格與matlab類似。Python機器學習庫非常多,而且大多數開源,主要有:

1. scikit-learn

scikit-learn 是一個基于SciPyNumpy的開源機器學習模塊,包括分類、回歸、聚類系列算法,主要算法有SVM、邏輯回歸、樸素貝葉斯、KmeansDBSCAN等,目前由INRI 資助,偶爾Google也資助一點。

項目主頁:

https://pypi.python.org/pypi/scikit-learn/

http://scikit-learn.org/

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

2. NLTK

NLTK(Natural Language Toolkit)Python的自然語言處理模塊,包括一系列的字符處理和語言統計模型。NLTK 常用于學術研究和教學,應用的領域有語言學、認知科學、人工智能、信息檢索、機器學習等。 NLTK提供超過50個語料庫和詞典資源,文本處理庫包括分類、分詞、詞干提取、解析、語義推理。可穩定運行在Windows, Mac OS XLinux平臺上

項目主頁:

http://sourceforge.net/projects/nltk/

https://pypi.python.org/pypi/nltk/

http://nltk.org/

3. Mlpy

Mlpy是基于NumPy/SciPyPython機器學習模塊,它是Cython的擴展應用。包含的機器學習算法有:

l  回歸

least squaresridge regression, least angle regression, elastic net, kernel ridge regression, support vector machines (SVM), partial least squares (PLS)

l  分類

linear discriminant analysis (LDA), Basic perceptron, Elastic Net, logistic regression, (Kernel) Support Vector Machines (SVM), Diagonal Linear Discriminant Analysis (DLDA), Golub Classifier, Parzen-based, (kernel) Fisher Discriminant Classifier, k-nearest neighbor, Iterative RELIEF, Classification Tree, Maximum Likelihood Classifier

l  聚類

hierarchical clustering, Memory-saving Hierarchical Clustering, k-means

l  維度約減

(Kernel) Fisher discriminant analysis (FDA), Spectral Regression Discriminant Analysis (SRDA), (kernel) Principal component analysis (PCA)

項目主頁:

http://sourceforge.net/projects/mlpy

https://mlpy.fbk.eu/

4. Shogun  

Shogun是一個開源的大規模機器學習工具箱。目前Shogun的機器學習功能分為幾個部分:feature表示,feature預處理, 核函數表示,核函數標準化,距離表示,分類器表示,聚類方法,分布, 性能評價方法,回歸方法,結構化輸出學習器。

SHOGUN 的核心由C++實現,提供 Matlab R Octave Python接口。主要應用在linux平臺上。

項目主頁:

http://www.shogun-toolbox.org/

5. MDP

The Modular toolkit for Data Processing (MDP) ,用于數據處理的模塊化工具包,一個Python數據處理框架。

從用戶的觀點,MDP是能夠被整合到數據處理序列和更復雜的前饋網絡結構的一批監督學習和非監督學習算法和其他數據處理單元。計算依照速度和內存需求而高效的執行。從科學開發者的觀點,MDP是一個模塊框架,它能夠被容易地擴展。新算法的實現是容易且直觀的。新實現的單元然后被自動地與程序庫的其余部件進行整合。MDP在神經科學的理論研究背景下被編寫,但是它已經被設計為在使用可訓練數據處理算法的任何情況中都是有用的。其站在用戶一邊的簡單性,各種不同的隨時可用的算法,及應用單元的可重用性,使得它也是一個有用的教學工具。

項目主頁:

http://mdp-toolkit.sourceforge.net/

https://pypi.python.org/pypi/MDP/

6. PyBrain

PyBrain(Python-Based Reinforcement Learning, Artificial Intelligence and Neural Network)Python的一個機器學習模塊,它的目標是為機器學習任務提供靈活、易應、強大的機器學習算法。(這名字很霸氣)

PyBrain正如其名,包括神經網絡、強化學習(及二者結合)、無監督學習、進化算法。因為目前的許多問題需要處理連續態和行為空間,必須使用函數逼近(如神經網絡)以應對高維數據。PyBrain以神經網絡為核心,所有的訓練方法都以神經網絡為一個實例。

項目主頁:

http://www.pybrain.org/

https://github.com/pybrain/pybrain/

7. BigML

BigML 使得機器學習為數據驅動決策和預測變得容易,BigML使用容易理解的交互式操作創建優雅的預測模型。BigML使用BigML.io,捆綁Python

項目主頁:

https://bigml.com/

https://pypi.python.org/pypi/bigml

http://bigml.readthedocs.org/

8. PyML

PyML是一個Python機器學習工具包, 為各分類和回歸方法提供靈活的架構。它主要提供特征選擇、模型選擇、組合分類器、分類評估等功能。

項目主頁:

http://cmgm.stanford.edu/~asab/pyml/tutorial/

http://pyml.sourceforge.net/

9.       Milk

MilkPython的一個機器學習工具箱,其重點是提供監督分類法與幾種有效的分類分析:SVMs(基于libsvm)K-NN,隨機森林經濟和決策樹。它還可以進行特征選擇。這些分類可以在許多方面相結合,形成不同的分類系統。

對于無監督學習,它提供K-meansaffinity propagation聚類算法。

項目主頁:

https://pypi.python.org/pypi/milk/

http://luispedro.org/software/milk

10. PyMVPA

PyMVPA(Multivariate Pattern Analysis in Python)是為大數據集提供統計學習分析的Python工具包,它提供了一個靈活可擴展的框架。它提供的功能有分類、回歸、特征選擇、數據導入導出、可視化等

項目主頁:

http://www.pymvpa.org/

https://github.com/PyMVPA/PyMVPA

11. Pattern 

PatternPythonweb挖掘模塊,它綁定了  Google推ter Wikipedia API,提供網絡爬蟲、HTML解析功能,文本分析包括淺層規則解析、WordNet接口、句法與語義分析、TF-IDFLSA等,還提供聚類、分類和圖網絡可視化的功能。

項目主頁:

http://www.clips.ua.ac.be/pages/pattern

https://pypi.python.org/pypi/Pattern

12. pyrallel

Pyrallel(Parallel Data Analytics in Python)基于分布式計算模式的機器學習和半交互式的試驗項目,可在小型集群上運行,適用范圍:

l  focus on small to medium dataset that fits in memory on a small (10+ nodes) to medium cluster (100+ nodes).

l  focus on small to medium data (with data locality when possible).

l  focus on CPU bound tasks (e.g. training Random Forests) while trying to limit disk / network access to a minimum.

l  do not focus on HA / Fault Tolerance (yet).

l  do not try to invent new set of high level programming abstractions (yet): use a low level programming model (IPython.parallel) to finely control the cluster elements and messages transfered and help identify what are the practical underlying constraints in distributed machine learning setting.

項目主頁:

https://pypi.python.org/pypi/pyrallel

http://github.com/pydata/pyrallel

13.  Monte

Monte ( machine learning in pure Python)是一個純Python機器學習庫。它可以迅速構建神經網絡、條件隨機場、邏輯回歸等模型,使用inline-C優化,極易使用和擴展。

項目主頁:

https://pypi.python.org/pypi/Monte

http://montepython.sourceforge.net

14.  Orange

Orange 是一個基于組件的數據挖掘和機器學習軟件套裝,它的功能即友好,又很強大,快速而又多功能的可視化編程前端,以便瀏覽數據分析和可視化,基綁定了 Python以進行腳本開發。它包含了完整的一系列的組件以進行數據預處理,并提供了數據帳目,過渡,建模,模式評估和勘探的功能。其由C++ Python開發,它的圖形庫是由跨平臺的Qt框架開發。

項目主頁:

https://pypi.python.org/pypi/Orange/

http://orange.biolab.si/

15.  Theano

Theano 是一個 Python 庫,用來定義、優化和模擬數學表達式計算,用于高效的解決多維數組的計算問題。Theano的特點:

l  緊密集成Numpy

l  高效的數據密集型GPU計算

l  高效的符號微分運算

l  高速和穩定的優化

l  動態生成c代碼

l  廣泛的單元測試和自我驗證

2007年以來,Theano已被廣泛應用于科學運算。theano使得構建深度學習模型更加容易,可以快速實現下列模型:

l  Logistic Regression

l  Multilayer perceptron

l  Deep Convolutional Network

l  Auto Encoders, Denoising Autoencoders

l  Stacked Denoising Auto-Encoders

l  Restricted Boltzmann Machines

l  Deep Belief Networks

l  HMC Sampling

l  Contractive auto-encoders

   Theano,一位希臘美女,Croton最有權勢的Milo的女兒,后來成為了畢達哥拉斯的老婆。

項目主頁:

http://deeplearning.net/tutorial/

https://pypi.python.org/pypi/Theano

16. Pylearn2

Pylearn2建立在theano上,部分依賴scikit-learn上,目前Pylearn2正處于開發中,將可以處理向量、圖像、視頻等數據,提供MLPRBMSDA等深度學習模型。Pylearn2的目標是:

  • Researchers add features as they need them. We avoid getting bogged down by too much top-down planning in advance.

  • A machine learning toolbox for easy scientific experimentation.

  • All models/algorithms published by the LISA lab should have reference implementations in Pylearn2.

  • Pylearn2 may wrap other libraries such as scikits.learn when this is practical

  • Pylearn2 differs from scikits.learn in that Pylearn2 aims to provide great flexibility and make it possible for a researcher to do almost anything, while scikits.learn aims to work as a “black box” that can produce good results even if the user does not understand the implementation

  • Dataset interface for vector, images, video, ...

  • Small framework for all what is needed for one normal MLP/RBM/SDA/Convolution experiments.

  • Easy reuse of sub-component of Pylearn2.

  • Using one sub-component of the library does not force you to use / learn to use all of the other sub-components if you choose not to.

  • Support cross-platform serialization of learned models.

  • Remain approachable enough to be used in the classroom (IFT6266 at the University of Montreal).

項目主頁:

http://deeplearning.net/software/pylearn2/

https://github.com/lisa-lab/pylearn2

   還有其他的一些Python的機器學習庫,如:

pmll(https://github.com/pavlov99/pmll)

pymining(https://github.com/bartdag/pymining)

ease (https://github.com/edx/ease)

textmining(http://www.christianpeccei.com/textmining/)

更多的機器學習庫可通過https://pypi.python.org/pypi查找。

原地址:http://qxde01.blog.163.com/blog/static/67335744201368101922991/


 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!