フィルターのクリア

Use cell arrays with neural networks in a regression problem.

2 ビュー (過去 30 日間)
Manuel Valenciano
Manuel Valenciano 2016 年 6 月 6 日
コメント済み: Sean de Wolski 2016 年 6 月 8 日
I want to use Neural Networks to predict a numeric value using text and numerical data. Here is an example:
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 ?

採用された回答

Sean de Wolski
Sean de Wolski 2016 年 6 月 6 日
編集済み: Sean de Wolski 2016 年 6 月 6 日
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 件のコメント
Manuel Valenciano
Manuel Valenciano 2016 年 6 月 7 日
I have a problem with the categorical function. Some variables of my problem are of the following type:
I want to convert it to a categorical array but the categorical function gives me the following error:
Error using categorical (line 321)
Could not find unique values in DATA using the UNIQUE function.
Caused by:
Error using cell/unique (line 85)
Input A must be a cell array of strings.
Sean de Wolski
Sean de Wolski 2016 年 6 月 8 日
You'll need to convert the numeric values to strings first.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePattern Recognition and Classification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by