
谷歌的AI擊敗了一位圍棋大師,是一種衡量人工智能突然的快速發(fā)展的方式,也揭示了這些技術(shù)如何發(fā)展而來(lái)和將來(lái)可以如何發(fā)展。
人工智能是一種未來(lái)性的技術(shù),目前正在致力于研究自己的一套工具。一系列的進(jìn)展在過(guò)去的幾年中發(fā)生了:無(wú)事故駕駛超過(guò)300000英里并在三個(gè)州合法行駛迎來(lái)了自動(dòng)駕駛的一個(gè)里程碑;IBM Waston擊敗了Jeopardy兩屆冠軍;統(tǒng)計(jì)學(xué)習(xí)技術(shù)從對(duì)消費(fèi)者興趣到以萬(wàn)億記的圖像的復(fù)雜數(shù)據(jù)集進(jìn)行模式識(shí)別。這些發(fā)展必然提高了科學(xué)家和巨匠們對(duì)人工智能的興趣,這也使得開(kāi)發(fā)者們了解創(chuàng)建人工智能應(yīng)用的真實(shí)本質(zhì)。開(kāi)發(fā)這些需要注意的第一件事是:
哪一種編程語(yǔ)言適合人工智能?
你所熟練掌握的每一種編程語(yǔ)言都可以是人工智能的開(kāi)發(fā)語(yǔ)言。
人工智能程序可以使用幾乎所有的編程語(yǔ)言實(shí)現(xiàn),最常見(jiàn)的有:Lisp,Prolog,C/C++,近來(lái)又有Java,最近還有Python.
LISP
像LISP這樣的高級(jí)語(yǔ)言在人工智能中備受青睞,因?yàn)樵诟鞲咝6嗄甑难芯亢筮x擇了快速原型而舍棄了快速執(zhí)行。垃圾收集,動(dòng)態(tài)類(lèi)型,數(shù)據(jù)函數(shù),統(tǒng)一的語(yǔ)法,交互式環(huán)境和可擴(kuò)展性等一些特性使得LIST非常適合人工智能編程。
PROLOG
這種語(yǔ)言有著LISP高層和傳統(tǒng)優(yōu)勢(shì)有效結(jié)合,這對(duì)AI是非常有用的。它的優(yōu)勢(shì)是解決“基于邏輯的問(wèn)題”。Prolog提供了針對(duì)于邏輯相關(guān)問(wèn)題的解決方案,或者說(shuō)它的解決方案有著簡(jiǎn)潔的邏輯特征。它的主要缺點(diǎn)(恕我直言)是學(xué)起來(lái)很難。
C/C++
就像獵豹一樣,C/C++主要用于對(duì)執(zhí)行速度要求很高的時(shí)候。它主要用于簡(jiǎn)單程序,統(tǒng)計(jì)人工智能,如神經(jīng)網(wǎng)絡(luò)就是一個(gè)常見(jiàn)的例子。Backpropagation 只用了幾頁(yè)的C/C++代碼,但是要求速度,哪怕程序員只能提升一點(diǎn)點(diǎn)速度也是好的。
JAVA
新來(lái)者,Java使用了LISP中的幾個(gè)理念,最明顯的是垃圾收集。它的可移植性使它可以適用于任何程序,它還有一套內(nèi)置類(lèi)型。Java沒(méi)有LISP和Prolog高級(jí),又沒(méi)有C那樣快,但如果要求可移植性那它是最好的。
PYTHON
Python是一種用LISP和JAVA編譯的語(yǔ)言。按照Norvig文章中對(duì)Lips和Python的比較,這兩種語(yǔ)言彼此非常相似,僅有一些細(xì)小的差別。還有JPthon,提供了訪問(wèn)Java圖像用戶界面的途徑。這是PeterNorvig選擇用JPyhton翻譯他人工智能書(shū)籍中程序的的原因。JPython可以讓他使用可移植的GUI演示,和可移植的http/ftp/html庫(kù)。因此,它非常適合作為人工智能語(yǔ)言的。
在人工智能上使用Python比其他編程語(yǔ)言的好處
優(yōu)質(zhì)的文檔
平臺(tái)無(wú)關(guān),可以在現(xiàn)在每一個(gè)*nix版本上使用
和其他面向?qū)ο缶幊陶Z(yǔ)言比學(xué)習(xí)更加簡(jiǎn)單快速
Python有許多圖像加強(qiáng)庫(kù)像Python Imaging Libary,VTK和Maya 3D可視化工具包,Numeric Python, Scientific Python和其他很多可用工具可以于數(shù)值和科學(xué)應(yīng)用。
Python的設(shè)計(jì)非常好,快速,堅(jiān)固,可移植,可擴(kuò)展。很明顯這些對(duì)于人工智能應(yīng)用來(lái)說(shuō)都是非常重要的因素。
對(duì)于科學(xué)用途的廣泛編程任務(wù)都很有用,無(wú)論從小的shell腳本還是整個(gè)網(wǎng)站應(yīng)用。
最后,它是開(kāi)源的??梢缘玫较嗤纳鐓^(qū)支持。
AI的Python庫(kù)
總體的AI庫(kù)
AIMA:Python實(shí)現(xiàn)了從Russell到Norvigs的“人工智能:一種現(xiàn)代的方法”的算法
pyDatalog:Python中的邏輯編程引擎
SimpleAI:Python實(shí)現(xiàn)在“人工智能:一種現(xiàn)代的方法”這本書(shū)中描述過(guò)的人工智能的算法。它專(zhuān)注于提供一個(gè)易于使用,有良好文檔和測(cè)試的庫(kù)。
EasyAI:一個(gè)雙人AI游戲的python引擎(負(fù)極大值,置換表、游戲解決)
機(jī)器學(xué)習(xí)庫(kù)
PyBrain 一個(gè)靈活,簡(jiǎn)單而有效的針對(duì)機(jī)器學(xué)習(xí)任務(wù)的算法,它是模塊化的Python機(jī)器學(xué)習(xí)庫(kù)。它也提供了多種預(yù)定義好的環(huán)境來(lái)測(cè)試和比較你的算法。
PyML 一個(gè)用Python寫(xiě)的雙邊框架,重點(diǎn)研究SVM和其他內(nèi)核方法。它支持Linux和Mac OS X。
scikit-learn旨在提供簡(jiǎn)單而強(qiáng)大的解決方案,可以在不同的上下文中重用:機(jī)器學(xué)習(xí)作為科學(xué)和工程的一個(gè)多功能工具。它是python的一個(gè)模塊,集成了經(jīng)典的機(jī)器學(xué)習(xí)的算法,這些算法是和python科學(xué)包(numpy,scipy.matplotlib)緊密聯(lián)系在一起的。
MDP-Toolkit這是一個(gè)Python數(shù)據(jù)處理的框架,可以很容易的進(jìn)行擴(kuò)展。它海收集了有監(jiān)管和沒(méi)有監(jiān)管的學(xué)習(xí)算飯和其他數(shù)據(jù)處理單元,可以組合成數(shù)據(jù)處理序列或者更復(fù)雜的前饋網(wǎng)絡(luò)結(jié)構(gòu)。新算法的實(shí)現(xiàn)是簡(jiǎn)單和直觀的??捎玫乃惴ㄊ窃诓粩嗟姆€(wěn)定增加的,包括信號(hào)處理方法(主成分分析、獨(dú)立成分分析、慢特征分析),流型學(xué)習(xí)方法(局部線性嵌入),集中分類(lèi),概率方法(因子分析,RBM),數(shù)據(jù)預(yù)處理方法等等。
自然語(yǔ)言和文本處理庫(kù)
NLTK 開(kāi)源的Python模塊,語(yǔ)言學(xué)數(shù)據(jù)和文檔,用來(lái)研究和開(kāi)發(fā)自然語(yǔ)言處理和文本分析。有windows,Mac OSX和Linux版本。
案例
做了一個(gè)實(shí)驗(yàn),一個(gè)使用人工智能和物聯(lián)網(wǎng)做員工行為分析的軟件。該軟件通過(guò)員工情緒和行為的分心提供了一個(gè)有用的反饋給員工,從而提高了管理和工作習(xí)慣。
使用Python機(jī)器學(xué)習(xí)庫(kù),opencv和haarcascading概念來(lái)培訓(xùn)。建立了樣品POC來(lái)檢測(cè)通過(guò)安置在不同地點(diǎn)的無(wú)線攝像頭傳遞回來(lái)基礎(chǔ)情感像幸福,生氣,悲傷,厭惡,懷疑,蔑視,譏諷和驚喜。收集到的數(shù)據(jù)會(huì)集中到云數(shù)據(jù)庫(kù)中,甚至整個(gè)辦公室都可以通過(guò)在Android設(shè)備或桌面點(diǎn)擊一個(gè)按鈕來(lái)取回。
開(kāi)發(fā)者在深入分析臉部情感上復(fù)雜點(diǎn)和挖掘更多的細(xì)節(jié)中取得進(jìn)步。在深入學(xué)習(xí)算法和機(jī)器學(xué)習(xí)的幫助下,可以幫助分析員工個(gè)人績(jī)效和適當(dāng)?shù)膯T工/團(tuán)隊(duì)反饋。
結(jié)論
python因?yàn)樘峁┫?scikit-learn的好的框架,在人工智能方面扮演了一個(gè)重要的角色:Python中的機(jī)器學(xué)習(xí),實(shí)現(xiàn)了這一領(lǐng)域中大多的需求。D3.js JS中數(shù)據(jù)驅(qū)動(dòng)文檔時(shí)可視化最強(qiáng)大和易于使用的工具之一。處理框架,它的快速原型制造使得它成為一門(mén)不可忽視的重要語(yǔ)言。AI需要大量的研究,因此沒(méi)有必要要求一個(gè)500KB的Java樣板代碼去測(cè)試新的假說(shuō)。python中幾乎每一個(gè)想法都可以迅速通過(guò)20-30行代碼來(lái)實(shí)現(xiàn)(JS和LISP也是一樣)。因此,它對(duì)于人工智能是一門(mén)非常有用的語(yǔ)言。
【英文原版】
Role of Python in Artificial Intelligence
Google’s AI Beating a Go Grandmaster is a way of judging the suddenly rapid progress of artificial intelligence that may show how far these technologies have come—and how far they may go.
Artificial intelligence is a futuristic technology that is working on its set of tools at present. A slew of advances has been observed in last few years: Self-driving cars that have achieved a milestone by logging over 300,000 accident-free miles and becoming officially legal in three states; IBM Watson which beat two champions of Jeopardy!; and statistical learning techniques are conducting pattern recognition on complex data sets from consumer interests to trillions of images. These developments certainly raised the number of scientists or giants taking interest in AI, which has made it essential for developers to understand the ground realities of building AI applications. The first thing that strikes developers is,
Which programming language is good for AI?
Every programming language is a AI language if you are adept in it!
AI programs are written in almost all the programming languages, the most common are: Lisp, Prolog, C/C++, recently Java, and even more recently, Python.
LISP
High-level languages like LISP are favored in AI because after many years of research in various universities fast prototyping was chosen over fast execution. Garbage collection, dynamic typing, functions as data, uniform syntax, interactive environment, and extensibility are some of its feature that makes the language suitable for AI programming.
PROLOG
This language comes with an effective combination of the high-level and traditional advantages of Lisp with a built-in unifier, which is particularly useful in AI. It’s strength is ‘logic based problems’. Prolog gives good solutions for problems in which logic is intimately involved, or whose solutions have a succinct logical characterization. Its major drawback (IMHO) is that it’s hard to learn.
C/C++
Cheetah of the bunch, C/C++ is mostly used when the speed of execution is most important. It is used mostly when the program is simple, statistical AI techniques such as neural networks are common examples of this. Backpropagation is only a couple of pages of C/C++ code, and needs every ounce of speed that the programmer can muster.
JAVA
The newcomer, Java uses several ideas from Lisp, most notably garbage collection. Its portability makes it desirable for just about any application, and it has a decent set of built in types. Java is still not as high-level as Lisp or Prolog, and not as fast as C, making it best when portability is paramount.
PYTHON
Python is a language with the best compilation of Lisp and Java both.According to Norvig is his text comparing Lisp to Python, these two languages are very similar to each other with some minor differences. There also exists JPython, giving access to the Java GUIs. This is the reason behind Peter Norvig choosing JPython to translate his programs from his AI book. As JPython allowed him to have portable GUI demos, and portable http/ftp/html libraries. Therefore, it is very good to use as AI language.
Benefits of Using Python over the Other Programming Languages for AI
1.Good quality documentation.
2.Platform agnostic, and present in virtually every *nix distribution.
3.Easy and fast to learn in comparison to any other OOP language.
4.Python has many image intensive libraries like Python Imaging Library, VTK and Maya 3D Visualization Toolkits, Numeric Python, Scientific Python and many other tools available for numeric and scientific applications.
5.Python is very well designed, fast, robust, portable, and scalable. These are evidently the most important factors for AI applications.
6.Useful for a really broad range of programming tasks from little shell scripts to enterprise web applications to scientific uses.
7.Last but not the least, it is Open Source! Good community support available for the same.
Python Libraries for AI
Libraries for General AI
1.AIMA – Python implementation of algorithms from Russell and Norvig’s ‘Artificial Intelligence: A Modern Approach’
2.pyDatalog – Logic Programming engine in Python
3.SimpleAI – Python implementation of many of the artificial intelligence algorithms described on the book “Artificial Intelligence, a Modern Approach”. It focuses on providing an easy to use, well documented and tested library.
4.EasyAI – Simple Python engine for two-players games with AI (Negamax, transposition tables, game solving).
Libraries for ML
1.PyBrain – It is a flexible, simple yet effective algorithms for ML tasks, it is a modular Machine Learning Library for Python. It also provides a variety of predefined environments to test and compare your algorithms.
2.PyML – A bilateral framework written in Python that focuses on SVMs and other kernel methods. It is supported on Linux and Mac OS X.
3.scikit-learn – It aims to provide easy and powerful solutions reusable in various contexts: machine-learning as a versatile tool for science and engineering. It is a Python module that integrates the classic classic machine learning algorithms in the tightly-knit world of scientific Python packages (numpy, scipy, matplotlib).
4.MDP-Toolkit – It is a Python data processing framework that can be easily expanded, it also has a collection of supervised and unsupervised learning algorithms and other data processing units that can be combined into data processing sequences and more complex feed-forward network architectures. The implementation of new algorithms is easy and intuitive. The base of available algorithms is steadily increasing and includes signal processing methods (Principal Component Analysis, Independent Component Analysis, Slow Feature Analysis), manifold learning methods ([Hessian] Locally Linear Embedding), several classifiers, probabilistic methods (Factor Analysis, RBM), data pre-processing methods, and many others.
Libraries for Natural Language & Text Processing
NLTK – Open source Python modules, linguistic data and documentation for research and development in natural language processing and text analytics, with distributions for Windows, Mac OSX and Linux.
Case Study
An experiment to bring AI to use with Internet of Things was done to make a software for employee behavioral analytics. The software provides useful feedback to the employees through employee emotions and behaviour analysis, thus enhancing positive changes in management and work habits.
Using python machine learning libraries, opencv and haarcascading concepts for application training, a sample POC was built to detect basic emotions like happiness, anger, sadness, disgust, suspicion, contempt, sarcasm and surprise through wireless cameras attached at various bay points. The data collected was feeded to a centralized cloud database where daily emotional quotient within the bay, or even the entire office could be retrieved at the click of a button either through android device or desktop.
Developers are making gradual progress in analyzing further complex points on facial emotions and mine more details with the help of deep learning algorithms and machine learning which can help analyze individual employee performance and help in proper employee/team feedback.
Conclusion
Python plays an important role in Artificial Intelligence by providing it with good frameworks like scikit-learn: machine learning in Python, which fulfills almost every need in this field and D3.js – Data-Driven Documents in JS, which is one of the most powerful and easy-to-use tools for visualization. Other than frameworks, it’s fast prototyping makes it an important language not to be ignored. AI needs a lot of research and hence it is necessary not to require a 500 KB boilerplate code in Java to test a new hypothesis, which will never finish the project. In Python almost every idea can be quickly validated through 20-30 lines of code (same for JS with libs). Therefore, it is a pretty useful language for the sake of AI.
數(shù)據(jù)分析咨詢請(qǐng)掃描二維碼
若不方便掃碼,搜微信號(hào):CDAshujufenxi
DSGE 模型中的 Et:理性預(yù)期算子的內(nèi)涵、作用與應(yīng)用解析 動(dòng)態(tài)隨機(jī)一般均衡(Dynamic Stochastic General Equilibrium, DSGE)模 ...
2025-09-17Python 提取 TIF 中地名的完整指南 一、先明確:TIF 中的地名有哪兩種存在形式? 在開(kāi)始提取前,需先判斷 TIF 文件的類(lèi)型 —— ...
2025-09-17CDA 數(shù)據(jù)分析師:解鎖表結(jié)構(gòu)數(shù)據(jù)特征價(jià)值的專(zhuān)業(yè)核心 表結(jié)構(gòu)數(shù)據(jù)(以 “行 - 列” 規(guī)范存儲(chǔ)的結(jié)構(gòu)化數(shù)據(jù),如數(shù)據(jù)庫(kù)表、Excel 表、 ...
2025-09-17Excel 導(dǎo)入數(shù)據(jù)含缺失值?詳解 dropna 函數(shù)的功能與實(shí)戰(zhàn)應(yīng)用 在用 Python(如 pandas 庫(kù))處理 Excel 數(shù)據(jù)時(shí),“缺失值” 是高頻 ...
2025-09-16深入解析卡方檢驗(yàn)與 t 檢驗(yàn):差異、適用場(chǎng)景與實(shí)踐應(yīng)用 在數(shù)據(jù)分析與統(tǒng)計(jì)學(xué)領(lǐng)域,假設(shè)檢驗(yàn)是驗(yàn)證研究假設(shè)、判斷數(shù)據(jù)差異是否 “ ...
2025-09-16CDA 數(shù)據(jù)分析師:掌控表格結(jié)構(gòu)數(shù)據(jù)全功能周期的專(zhuān)業(yè)操盤(pán)手 表格結(jié)構(gòu)數(shù)據(jù)(以 “行 - 列” 存儲(chǔ)的結(jié)構(gòu)化數(shù)據(jù),如 Excel 表、數(shù)據(jù) ...
2025-09-16MySQL 執(zhí)行計(jì)劃中 rows 數(shù)量的準(zhǔn)確性解析:原理、影響因素與優(yōu)化 在 MySQL SQL 調(diào)優(yōu)中,EXPLAIN執(zhí)行計(jì)劃是核心工具,而其中的row ...
2025-09-15解析 Python 中 Response 對(duì)象的 text 與 content:區(qū)別、場(chǎng)景與實(shí)踐指南 在 Python 進(jìn)行 HTTP 網(wǎng)絡(luò)請(qǐng)求開(kāi)發(fā)時(shí)(如使用requests ...
2025-09-15CDA 數(shù)據(jù)分析師:激活表格結(jié)構(gòu)數(shù)據(jù)價(jià)值的核心操盤(pán)手 表格結(jié)構(gòu)數(shù)據(jù)(如 Excel 表格、數(shù)據(jù)庫(kù)表)是企業(yè)最基礎(chǔ)、最核心的數(shù)據(jù)形態(tài) ...
2025-09-15Python HTTP 請(qǐng)求工具對(duì)比:urllib.request 與 requests 的核心差異與選擇指南 在 Python 處理 HTTP 請(qǐng)求(如接口調(diào)用、數(shù)據(jù)爬取 ...
2025-09-12解決 pd.read_csv 讀取長(zhǎng)浮點(diǎn)數(shù)據(jù)的科學(xué)計(jì)數(shù)法問(wèn)題 為幫助 Python 數(shù)據(jù)從業(yè)者解決pd.read_csv讀取長(zhǎng)浮點(diǎn)數(shù)據(jù)時(shí)的科學(xué)計(jì)數(shù)法問(wèn)題 ...
2025-09-12CDA 數(shù)據(jù)分析師:業(yè)務(wù)數(shù)據(jù)分析步驟的落地者與價(jià)值優(yōu)化者 業(yè)務(wù)數(shù)據(jù)分析是企業(yè)解決日常運(yùn)營(yíng)問(wèn)題、提升執(zhí)行效率的核心手段,其價(jià)值 ...
2025-09-12用 SQL 驗(yàn)證業(yè)務(wù)邏輯:從規(guī)則拆解到數(shù)據(jù)把關(guān)的實(shí)戰(zhàn)指南 在業(yè)務(wù)系統(tǒng)落地過(guò)程中,“業(yè)務(wù)邏輯” 是連接 “需求設(shè)計(jì)” 與 “用戶體驗(yàn) ...
2025-09-11塔吉特百貨孕婦營(yíng)銷(xiāo)案例:數(shù)據(jù)驅(qū)動(dòng)下的精準(zhǔn)零售革命與啟示 在零售行業(yè) “流量紅利見(jiàn)頂” 的當(dāng)下,精準(zhǔn)營(yíng)銷(xiāo)成為企業(yè)突圍的核心方 ...
2025-09-11CDA 數(shù)據(jù)分析師與戰(zhàn)略 / 業(yè)務(wù)數(shù)據(jù)分析:概念辨析與協(xié)同價(jià)值 在數(shù)據(jù)驅(qū)動(dòng)決策的體系中,“戰(zhàn)略數(shù)據(jù)分析”“業(yè)務(wù)數(shù)據(jù)分析” 是企業(yè) ...
2025-09-11Excel 數(shù)據(jù)聚類(lèi)分析:從操作實(shí)踐到業(yè)務(wù)價(jià)值挖掘 在數(shù)據(jù)分析場(chǎng)景中,聚類(lèi)分析作為 “無(wú)監(jiān)督分組” 的核心工具,能從雜亂數(shù)據(jù)中挖 ...
2025-09-10統(tǒng)計(jì)模型的核心目的:從數(shù)據(jù)解讀到?jīng)Q策支撐的價(jià)值導(dǎo)向 統(tǒng)計(jì)模型作為數(shù)據(jù)分析的核心工具,并非簡(jiǎn)單的 “公式堆砌”,而是圍繞特定 ...
2025-09-10CDA 數(shù)據(jù)分析師:商業(yè)數(shù)據(jù)分析實(shí)踐的落地者與價(jià)值創(chuàng)造者 商業(yè)數(shù)據(jù)分析的價(jià)值,最終要在 “實(shí)踐” 中體現(xiàn) —— 脫離業(yè)務(wù)場(chǎng)景的分 ...
2025-09-10機(jī)器學(xué)習(xí)解決實(shí)際問(wèn)題的核心關(guān)鍵:從業(yè)務(wù)到落地的全流程解析 在人工智能技術(shù)落地的浪潮中,機(jī)器學(xué)習(xí)作為核心工具,已廣泛應(yīng)用于 ...
2025-09-09SPSS 編碼狀態(tài)區(qū)域中 Unicode 的功能與價(jià)值解析 在 SPSS(Statistical Product and Service Solutions,統(tǒng)計(jì)產(chǎn)品與服務(wù)解決方案 ...
2025-09-09