《量化投资:以MATLAB为工具》

MATLAB技术论坛

 找回密码
 注册账号
查看: 235|回复: 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-22 00:26 , Processed in 0.076334 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表