Use cell arrays with neural networks in a regression problem.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Manuel Valenciano
am 6 Jun. 2016
Kommentiert: Sean de Wolski
am 8 Jun. 2016
I want to use Neural Networks to predict a numeric value using text and numerical data. Here is an example:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/165761/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/165762/image.jpeg)
It's a regression problem. If I try to use the Neural fitting (nftool) app, only allows use numerical data.
A solution that I can think of is to assign numerical values to each class in the text data values , but I think it is too computationally expensive , as my dataset has a size 17000x40.
Is there any way to use neural networks in a regression problem using cell data type ?
0 Kommentare
Akzeptierte Antwort
Sean de Wolski
am 6 Jun. 2016
Bearbeitet: Sean de Wolski
am 6 Jun. 2016
First, convert your cell array to a table (cell2table). Tables make working with this type of data much easier.
Then, convert the cell strings to categoricals and then dummy code them using dummyvar or my dummytable, attached.
x = table(rand(3,1),{'A';'B';'C'});
x.Var2 = categorical(x.Var2);
xdummy = dummytable(x);
Xnumeric = table2array(xdummy)
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Pattern Recognition and Classification finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!