how to predict test data from trained model
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Sammit Jain
el 10 de Jul. de 2018
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.
Respuestas (1)
Rahul Madan Raju
el 9 de En. de 2019
predictors = inputTable(:, predictorNames{:})
You can try this code at the place of 'predictors = inputTable(:, predictorNames)'
2 comentarios
ferkous ahmed
el 17 de En. de 2019
Try to make sure that all the data contains a comma instead of a dot
Thanks
Warid Islam
el 20 de Jun. de 2020
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));
Ver también
Categorías
Más información sobre Classification Learner App en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!