Nonlinear Regression w/ categorical predictors?

2 ビュー (過去 30 日間)
Benedict Kriegler
Benedict Kriegler 2016 年 2 月 19 日
コメント済み: Tom Lane 2016 年 2 月 19 日
Hi community,
I am looking for a way to perform a nonlinear regression including categorical predictors, by using the Statistics and Machine Learning Toolbox. I did not found a way to consider categorical values with finlm or nlinfit.
Thanks in advance Benedict
  1 件のコメント
Tom Lane
Tom Lane 2016 年 2 月 19 日
Can you give an example? In nonlinear regression you generally write an equation with unknown parameters and estimate them. How would you like to express an equation with categorical predictors?

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

回答 (1 件)

MHN
MHN 2016 年 2 月 19 日
編集済み: MHN 2016 年 2 月 19 日
I am using Matlab R2014b and I have the same problem. It seems in Matlab R2015 this problem is solved since you can use not only matrix as inputs but also table as the input. But if you are using the previous version you should change your categorical attributes to numerical and then define them as categorical predictors for your model. Right now I am trying to write a code which changes the categorical attributes (both string and numerical) to numerical. I can send you the code, if you want.
  1 件のコメント
MHN
MHN 2016 年 2 月 19 日
By the way, see the following code which might help:
cat = categorical({'g' 'r' 'b'; 'b' 'r' 'g'});
numeric_cat = double(cat);

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

カテゴリ

Help Center および File ExchangeGaussian Process Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by