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 个评论
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!