How do you test a classification model in real time with certain set of variables?

5 vues (au cours des 30 derniers jours)
Lynn Marciano
Lynn Marciano le 6 Avr 2018
Commenté : Daniel Leal le 1 Mar 2020
So I've created a classification model that uses about 70 features. I have exported my model to the workspace and have also saved it as a file. I've also exported the code to train new data. I have a radar and I want to use the classification model to predict the outcome of the data. Would I have to structure the incoming data to match the original test data that I used in the classification learner; and if so, how would I do this? I've been stuck on it awhile and tried to assign the variables to incoming data, but it created a table for me instead of predicting the incoming data in real time. Thanks in advance for all your help!

Réponses (1)

Bernhard Suhm
Bernhard Suhm le 9 Avr 2018
Yes, you have to process the incoming data so its columns are named the same (and in the same order) as how you structured the dataset you read into the Classification Learner. Of course you don't have the response (last column). Then you can use the predict method with that new data table and the model object you exported from the classification learner. This runs in batch mode. - To do this in real time, you'd have to program a server of some kind that either runs your prediction code in its compiled form, or (fancier) you convert the prediction into C-code using MATLAB coder and run that on your system in realtime.
  2 commentaires
Lynn Marciano
Lynn Marciano le 9 Avr 2018
Could I use bagOfFeatures function to extract the features to run through the classification learner?
Daniel Leal
Daniel Leal le 1 Mar 2020
Hey Lynn, did you ever find a solution to this? I am currently in the same predicament. Thanks!

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by