Failed to Call Classification Learner's Testing Function
Mostrar comentarios más antiguos
I was using a Matlab R2015b's Classification Learner Toolbox. I was successful in importing file data and export it into an Export Model, and i got a structure named trainedClassifier.
Import process #1

Import process #2

Training process with PCA implemented & Multi Class SVM (One vs All validation)

trainedClassifier variable generated from ToolBox

fetureVector variable which used for testing
yfit = trainedClassifier.predictFcn(featureVector)

>> yfit = trainedClassifier.predictFcn(featureVector)
Then i got an error output as a follows :
Function 'subsindex' is not defined for values of class 'cell'.
Error in mlearnapp.internal.model.DatasetSpecification>@(t)t(:,predictorNames) (line 135)
extractPredictorsFromTableFcn = @(t) t(:,predictorNames);
Error in mlearnapp.internal.model.DatasetSpecification>@(x)extractPredictorsFromTableFcn(splitMatricesInTableFcn(convertMatrixToTableFcn(x)))
(line 136)
extractPredictorsFcn = @(x) extractPredictorsFromTableFcn(splitMatricesInTableFcn(convertMatrixToTableFcn(x)));
Error in mlearnapp.internal.model.DatasetSpecification>@(x)exportableClassifier.predictFcn(extractPredictorsFcn(x)) (line 137)
exportableClassifier.predictFcn = @(x) exportableClassifier.predictFcn(extractPredictorsFcn(x));
What is the problem and solutions?
Thanks in advance.
11 comentarios
Walter Roberson
el 21 de En. de 2016
What is the data type of featureVector4 ?
The error message is saying that something is being indexed with a value that is a cell array.
Angga Lisdiyanto
el 21 de En. de 2016
Angga Lisdiyanto
el 23 de En. de 2016
Walter Roberson
el 23 de En. de 2016
That report does not appear to be relevant.
Angga Lisdiyanto
el 24 de En. de 2016
Walter Roberson
el 24 de En. de 2016
No, that should be fine.
Could you show the output of
which -all table
?
Angga Lisdiyanto
el 24 de En. de 2016
Angga Lisdiyanto
el 27 de En. de 2016
Angga Lisdiyanto
el 9 de Abr. de 2016
PAVITHRA S
el 2 de Mzo. de 2020
i tried the above code to test my trained network(classiification learner app). i am unable to execute the code
VarNames = arrayfun(@(N) sprintf('VarName%d',N), 1:512, 'Uniform', 0);
FV_table = array2table( featureVector, 'VariableNames', VarNames);
yfit = trainedClassifier.predictFcn(FV_table)
can u suggest me a solution to test.
Mrutyunjaya Hiremath
el 12 de Abr. de 2020
'testingData.xlsx' contains only 512 colums feature vector of tesing data or matrix of N X 512.
testingData = xlsread('testingData.xlsx');
yFit = trainedClassifier.predictFcn(testingData);
Respuesta aceptada
Más respuestas (2)
naishi feng
el 6 de Jun. de 2017
0 votos
it works!!thanks!!!
Jingwei Too
el 23 de Jul. de 2020
0 votos
you may have a look on this toolbox https://www.mathworks.com/matlabcentral/fileexchange/71461-simple-machine-learning-algorithms-for-classification?s_tid=prof_contriblnk
Categorías
Más información sobre Support Vector Machine Regression en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







