Scikit learn機器學習庫的安裝

2021-08-07 19:41:28 字數 2632 閱讀 2766

scikit-learn是python的乙個開源機器學習模組,它建立在numpy、matplotlib和scipy模組之上能夠為使用者提供各種機器學習演算法介面,可以讓使用者簡單、高效地進行資料探勘和資料分析。numpy-1.11.3+mkl-cp27-cp27m-win_amd64.whl

scipy-0.19.1-cp27-cp27m-win_amd64.whl

經檢驗:64位的不匹配

檢視:顯示當前版本資訊

>>>import pip

>>> print(pip.pep425tags.get_supported())   

===>>(cp27,cp27m,win32)

故選擇安裝:numpy-1.13.1+mkl-cp27-cp27m-win32.whl、matplotlib-1.5.3-cp27-cp27m-win32.whl、

scipy-0.19.1-cp27-cp27m-win32.whl和scikit_learn-0.19.0-cp27-cp27m-win32.whl 

一、安裝順序及過程:

1、安裝wheel

===d:\軟體\python\setup\scripts>>pip install wheel

2、安裝numpy-1.13.1+mkl-cp27-cp27m-win32.whl

===d:\軟體\python\setup\scripts>>pip install d:\軟體\sklearn\new\numpy-1.13.1+mkl-cp27-cp27m-win32.whl

3、安裝matplotlib-1.5.3-cp27-cp27m-win32.whl

===d:\軟體\python\setup\scripts>>pip install d:\軟體\sklearn\new\matplotlib-1.5.3-cp27-cp27m-win32.whl

4、安裝scipy-0.19.1-cp27-cp27m-win32.whl

===d:\軟體\python\setup\scripts>>pip install d:\軟體\sklearn\new\scipy-0.19.1-cp27-cp27m-win32.whl

5、安裝scikit_learn-0.19.0-cp27-cp27m-win32.whl

===d:\軟體\python\setup\scripts>>pip install scikit_learn-0.19.0-cp27-cp27m-win32.whl

出現問題:raise readtimeouterror(self._pool, none, 'read timed out.') readtimeouterror: httpsconnectionpool

解決方法:設定超時時間

===d:\軟體\python\setup\scripts>>pip --default-timeout=100 install -u sklearn

二、安裝過程遇到的一些問題:

1、file "c:\python27\lib\ntpath.py", line 85, in join

result_path = result_path + p_path

unicodedecodeerror: 'ascii' codec can't decode byte 0xc0 in position 0: ordinal not in range(128)

解決辦法:d:\軟體\python\setup\lib\ntpath.py   

85行改為:

sysencoding = sys.getfilesystemencoding()

try:

result_path = result_path + p_path

except unicodedecodeerror :

result_path = result_path.decode(sysencoding).encode(sysencoding)+p_path.decode(sysencoding).encode(sysencoding)

2、file "d:\軟體\python\setup\lib\site-packages\pip-9.0.1-py2.7.egg\pip\wheel.py" ,line 184, in fix_script

exename = sys.executable.encode(sys.getfilesystemencoding())

unicodedecodeerror: 'utf8' codec can't decode byte 0xc8 in position 3: invalid continuation byte

解決辦法:

try:

exename = sys.executable.encode(sys.getfilesystemencoding())

except unicodedecodeerror :

exename = sys.executable.decode(sys.getfilesystemencoding()).encode(sys.getfilesystemencoding())

scikit learn機器學習簡介

目錄 機器學習 問題設定 載入示例資料集 學習和 模型永續性 約定拓展知識鏈結 在本節中,我們介紹整個scikit learn中使用的機器學習詞彙,並給出了乙個簡單的學習示例。機器學習 問題設定 通常,學習問題會考慮一組n個資料樣本,然後嘗試 未知資料的屬性。如果每個樣本都大於乙個數字,例如是多維條...

機器學習及scikit learn

1.機器學習基本步驟 1 定義一系列函式 2 定義函式的優劣 3 選擇最優函式 2.什麼是scikit learn?1 面向python的免費機器學習庫 2 包含分類 回歸 聚類演算法,比如 svm 隨機森林 k means等 3 包含降維 模型選擇 預處理等演算法 4 支援numpy和scipy資...

機器學習 scikit learn(1)

1.通過樣本來 未知的資料 通過學習資料集的特徵 訓練集 training set 來應用到新的資料上。2.監督學習 分類 樣本屬於多於兩個類,我們想要從已經標記過的資料來 未標記資料的類 digits 回歸 如果想要的輸出包括多餘乙個連續的變數 無監督 訓練集包括一系列的向量x而沒有相對應的y 目...