Is fitcensemble blocked when called from the MATLAB engine in Python?

5 vues (au cours des 30 derniers jours)
Steve Goley
Steve Goley le 7 Juil 2017
I have a use case where I'm trying to call fitcensemble within a function that is called from the MATLAB engine within Python. It appears that the function cannot be found when called in this way. I make a call to trainAndSaveModel from within Python. This is a simplified version that I wrote to try and debug this issue.
function status = trainAndSaveModel(feature_matrix, label_matrix, savePath, learnerParams, trainingParams)
status = 1;
ver
which fitcensemble
produces this output:
----------------------------------------------------------------------------------------------------
MATLAB Version: 9.0.0.341360 (R2016a)
MATLAB License Number: ••••••
Operating System: Linux 4.4.0-75-generic #96-Ubuntu SMP Thu Apr 20 09:56:33 UTC 2017 x86_64
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
MATLAB Version 9.0 (R2016a)
Image Processing Toolbox Version 9.4 (R2016a)
Neural Network Toolbox Version 9.0 (R2016a)
Parallel Computing Toolbox Version 6.8 (R2016a)
Signal Processing Toolbox Version 7.2 (R2016a)
Statistics and Machine Learning Toolbox Version 10.2 (R2016a)
'fitcensemble' not found.
Whereas if I just call which on fitcensemble from MATLAB directory it is able to find it:
which fitcensemble
/usr/local/MATLAB/R2016b/toolbox/stats/classreg/fitcensemble.m
I looked through some documentation and didn't see this as a limitation. Can anyone help me on this or do I have to make a system call to MATLAB to access fitcensemble?

Réponses (1)

Walter Roberson
Walter Roberson le 7 Juil 2017
Your invocation from python is getting a MATLAB R2016 A instance, but fitcensemble is on your MATLAB R2016 B path.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by