フィルターのクリア

Store logistic regression models in an array?

3 ビュー (過去 30 日間)
shane
shane 2013 年 9 月 19 日
I have a for loop that creates a set of binary logistic regression models using the GeneralizedLinearModel.stepwise() function.
I need to store these models but I receive errors when I try to use an array or a structure to store them.
eg)
Output.Model(Model_Num) = GeneralizedLinearModel.stepwise()
"Error using classreg.regr.FitObject/subsref (line 710) Parentheses indexing is not allowed"
OR:
Model{Model_Num} = GeneralizedLinearModel.stepwise()
"Cell contents assignment to a non-cell array object."
OR:
Model(Model_Num) = GeneralizedLinearModel.stepwise()
"The following error occurred converting from GeneralizedLinearModel to double: Error using double Conversion to double from GeneralizedLinearModel is not possible."
But I don't think it works for logistic regression models varying number of parameters.
Is this perhaps not possible, in which case is my only option to use the count variable in the naming of the different models (I have read this is not advised). Thanks!

採用された回答

Shashank Prasanna
Shashank Prasanna 2013 年 9 月 20 日
編集済み: Shashank Prasanna 2013 年 9 月 20 日
mdl = GeneralizedLinearModel.stepwise(....)
Model{1} = mdl;
Model{2} = mdl;
Storing the models in a cell array works perfectly fine for me. Could you share your code so that we can see what's going wrong?
  1 件のコメント
shane
shane 2013 年 9 月 20 日
Thank you. The problem was that I was assigning the model directly to the array. I needed to store it to mdl first as you did above.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSupport Vector Machine Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by