《量化投資:以MATLAB為工具》

MATLAB技術論壇

 找回密碼
 注冊賬號
查看: 213|回復: 0
打印 上一主題 下一主題
收起左側

[提問] 第30章隨機森林,工具箱安裝失敗

[復制鏈接]
跳轉到指定樓層
樓主
發表于 2019-5-22 10:46:23 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
按照步驟,將工具箱添加到路徑(圖1),在運行compile_windows函數時頻繁報錯(圖2-圖7),請問該怎么解決?

不知道圖片有沒有上傳成功,我把錯誤信息復制出來(兩個文件夾下的compile_windows都運行了):
1、運行RF_Class_C文件夾下的compile_windows函數

找不到 E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\*.mexw32
I am going to use the precompiled fortran file
If it doesnt work then use cygwin+g77 (or gfortran) to recompile rfsub.f
使用 'Microsoft Windows SDK 7.1 (C++)' 編譯。
錯誤使用 mex
mex_ClassificationRF_train.cpp
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(30) :
warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(31) :
warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(89) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(97) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(111) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(114) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(119) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(122) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(131) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(134) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(140) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(141) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(146) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(147) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(157) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(161) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(165) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(169) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(174) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(179) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(182) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(196) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Class_C\src\mex_ClassificationRF_train.cpp(199) :
error C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)



出錯 compile_windows (line 16)
        mex  -DMATLAB -DWIN64 -output mexClassRF_train   src/classRF.cpp src/classTree.cpp src/cokus.cpp
        precompiled_rfsub/win64/rfsub.o src/mex_ClassificationRF_train.cpp   src/rfutils.cpp

2、運行RF_Reg_C文件夾下的compile_windows函數


找不到 E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\*.mexw32
使用 'Microsoft Windows SDK 7.1 (C++)' 編譯。
錯誤使用 mex
mex_regressionRF_train.cpp
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(68) : warning
C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(69) : warning
C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(124) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(131) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(136) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(144) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(149) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(158) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(163) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(177) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(180) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(187) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(193) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(199) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(205) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(211) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(217) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(223) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(227) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(253) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(258) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(263) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)
E:\MATLAB\Matlab 2014a\toolbox\randomforest-matlab\RF_Reg_C\src\mex_regressionRF_train.cpp(266) : error
C2664: 'mxCreateNumericMatrix_700' : cannot convert parameter 4 from 'int' to 'mxComplexity'
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or
        function-style cast)



出錯 compile_windows (line 17)
mex src/cokus.cpp src/reg_RF.cpp src/mex_regressionRF_train.cpp   -DMATLAB -output mexRF_train

本帖子中包含更多資源

您需要 登錄 才可以下載或查看,沒有帳號?注冊賬號

x
您需要登錄后才可以回帖 登錄 | 注冊賬號

本版積分規則

QQ|網站地圖|MATLAB技術論壇|Simulink仿真論壇 ( 蜀ICP備19014457號 

GMT+8, 2019-8-12 02:56 , Processed in 0.072833 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回復 返回頂部 返回列表
传奇电子琴弹奏
今晚东方心经资料2019 马后炮解太湖字谜 体彩七星彩开奖结果 快乐十分前三组选直选 重庆时时官网开奖结果 云南时时下载手机版 期期准 时时彩计划稳赢版免费 海南麻将放炮 重庆桥洞下算彩票人 上海11选五走势图上海 hi彩分分彩开奖 湖北快三顺序走势图 快乐十分0611036开奖号码 快乐时时开奖号码查询 山东时时后一走势