how to predict test data from trained model
조회 수: 7 (최근 30일)
이전 댓글 표시
i'm making a project in which i have to classify hand gestures. i have a feature file(made in excel). i have trained a model using classification learner app. now prediction is supposed to be done by getting a new image of hand gesture and calculating all those features in an array. now i want that array as testing data. i am unable to predict that testing data from already trained model.i have changed array to matrix as well as table but failed. please help me out.
댓글 수: 2
Sammit Jain
2018년 7월 10일
Hi, I think it'd help a lot if you could share some information about the dimensions of your dataset. Given that, the usual way to go about it would be to feed your features into the predict function in the same way as you put your training data.
답변 (1개)
Rahul Madan Raju
2019년 1월 9일
predictors = inputTable(:, predictorNames{:})
You can try this code at the place of 'predictors = inputTable(:, predictorNames)'
댓글 수: 2
ferkous ahmed
2019년 1월 17일
Try to make sure that all the data contains a comma instead of a dot
Thanks
Warid Islam
2020년 6월 20일
Hi guys,
I am having a smimilar problem where I want to test the model on a test image. I used the following line of code.
signalTemp2 = trainedModel.predictFcn(statsArray1);
But I get the following error.
Unable to use a value of type 'cell' as an index.
Error in mlearnapp.internal.model.DatasetSpecification>@(t)t(:,predictorNames) (line 156)
extractPredictorsFromTableFcn = @(t) t(:,predictorNames);
Error in mlearnapp.internal.model.DatasetSpecification>@(x)extractPredictorsFromTableFcn(x) (line 161)
predictorExtractionFcn = @(x) extractPredictorsFromTableFcn(x);
Error in mlearnapp.internal.model.DatasetSpecification>@(x)exportableModel.predictFcn(predictorExtractionFcn(x)) (line 165)
newExportableModel.predictFcn = @(x) exportableModel.predictFcn(predictorExtractionFcn(x));
참고 항목
카테고리
Help Center 및 File Exchange에서 Classification Learner App에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!