win10中matlabR2015b安裝libsvm

最近在學習SVM,因此需要在matlab上運行代碼,下載了一個svm安裝包,老是提示找不到svmtrain,後來發現是沒有編譯器,不能編譯,準備裝個vs,結果安裝到一半總是失敗,錯誤信息是:visual studio核心功能出錯,無奈之下一鍵還原電腦,重新來一遍,以下是過程:

環境:win8.1,64位


1.首先下載visual studio 2015 professional 下載地址https://yunpan.cn/cqD3ARrKxeVFj  訪問密碼 821d

由於電腦一鍵還原了,所以這次沒有出現什麼錯誤,值得注意的是,有一個步驟要選擇安裝的功能,要記得選擇編程語言。


2.下載matlabr2015b,下載地址https://yunpan.cn/cqDLItUxZQJYf  訪問密碼 15fb

matlab破解過程:在上述給出的下載文件中,查看Matlab 2015b Win64 Crack中的readme.txt,有完整的介紹:

I offer two modes of installation:
1) standalone:把R2015b下的文件複製到安裝目錄下把裏邊的內容覆蓋
- Install choosing the option “Use a File Installation Key” and supply the following FIK
09806-07443-53955-64350-21751-41297(1)
- To install Matlab Production Server,using this
40236-45817-26714-51426-39281
- Use license_standalone.lic to activate(2),
  or make a “licenses” folder in %installdir% and copy license_standalone.lic to it,and run matlab without activation
- after the installation finishes copy the folders to %installdir% to overwriting the originally installed files(3)
2) floating license (network license server):
- Install choosing the option “Use a File Installation Key” and supply the following FIK
31095-30030-55416-47440-21946-54205
- To install Matlab Production Server,using this
57726-51709-20682-42954-31195
- Use license_server.lic when asked
- after the installation finishes copy the folders to %installdir% to overwriting the originally installed files

把這個翻譯一遍吧,就是有兩種破解方法,

第一種:按順序使用密鑰09806-07443-53955-64350-21751-41297和40236-45817-26714-51426-39281,接下來有個選擇執行文件的步驟,選擇Matlab 2015b Win64 Crack中的 license_standalone.lic來激活。

第二種:密鑰爲31095-30030-55416-47440-21946-54205和57726-51709-20682-42954-31195,選擇 license_server.lic

我一開始選擇第二種方法,出錯了!!!!提示:License checkout failed!

所以還是建議大家選擇第一種破解方法


3.安裝好了vs和matlab,接下來就要編譯libsvm了:

1)到http://www.csie.ntu.edu.tw/~cjlin/libsvm/下載libsvm包,解壓後放在任意目錄下,最好放在MATLAB工具箱中,比如 \MATLAB\R2011a\toolbox\libsvm,然後添加到matlab中——選擇matlab主頁中的設置路徑


添加幷包含子文件libsvm


2)打開 matlab,切換到matlab2015b\toolbox\libsvm\matlab目錄下


輸入以下命令:

mex -setup


make


3)檢驗是否安裝成功,可執行以下步驟:

在路徑matlab2015b\toolbox\libsvm\matlab目錄下,

>> load heart_scale
錯誤使用 load
ASCII 文件 heart_scale 的第 3 行中的列數必須與前面行中的列數相同。


 一開始加載heart_scale錯誤,然後就重新下載了一份heart_scale.mat,下載地址:https://yunpan.cn/cqDrGp6kkAX5P  訪問密碼 3787

然後把heart_scale.mat放到matlab2015b\toolbox\libsvm\matlab目錄下

測試成功。

>> load heart_scale.mat
>> model = svmtrain(heart_scale_label,heart_scale_inst); 
*
optimization finished, #iter = 162
nu = 0.431029
obj = -100.877288, rho = 0.424462
nSV = 132, nBSV = 107
Total nSV = 132
>>  [predict_label,accuracy] = svmpredict(heart_scale_label,heart_scale_inst,model);
Usage: [predicted_label, accuracy, decision_values/prob_estimates] = svmpredict(testing_label_vector, testing_instance_matrix, model, ‘libsvm_options’)
       [predicted_label] = svmpredict(testing_label_vector, testing_instance_matrix, model, ‘libsvm_options’)
Parameters:
  model: SVM model structure from svmtrain.
  libsvm_options:
    -b probability_estimates: whether to predict probability estimates, 0 or 1 (default 0); one-class SVM not supported yet
    -q : quiet mode (no outputs)
Returns:
  predicted_label: SVM prediction output vector.
  accuracy: a vector with accuracy, mean squared error, squared correlation coefficient.
  prob_estimates: If selected, probability estimate vector.



注,最好到http://www.csie.ntu.edu.tw/~cjlin/libsvm/下載libsvm包

之前不知道哪裏下載的會出現問題:






發佈了26 篇原創文章 · 獲贊 15 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章