Classificaiton Learner App: shortens variable names?
2 views (last 30 days)
Show older comments
I'm using the Classification Learner App from MATLAB to examine features from medical images. The features are loaded into MATLAB from an excel file.
As you can see below these features can have pretty long names.
The Classification Learner App shortens these variable names to some variable name length limit without spaces. The variable name shown above gets shortened to:
'T1cetotalabnormalGLCMInformationalmeasureofcorrelation1d1mean'
After training a model with the App (e.g. trainedModel), this can be verified when using: trainedModel.RequiredVariables.
I want to validate the trainedModel with an external validation dataset. To this end I'm making a MATLAB table with rows and columns respectively equal to patient and feature (analog to the training data). The variable names need to be equal to the variable names of the trainedModel. However I don't know what method the Classification Learner App used to shorten the variables. Can somebody point this method out?
I know an easy way to get around this would be to rename the variables. However there are thousands of variables, so I would like to avoid this.
Thanks in advance
Sam
0 Comments
Answers (1)
Vinai Datta Thatiparthi
on 15 Sep 2020
Hey Sam,
The variable name that can be seen in the snapshot you provided does not seem to be a valid variable name in MATLAB. The Classification Learner App probably makes use of functions like matlab.lang.makeValidName to modify any given name into a valid one - something that MATLAB can make sense out of.
As a workaround, you could extract the variable names from the table properties directly. This would preserve the names' consistency. Use:
myVarNames = tableFromExcel.Properties.VariableNames;
Hope this helps!
0 Comments
See Also
Categories
Find more on Classification Learner App in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!