Error occurred in fitlm function.

조회 수: 14 (최근 30일)
Devendra
Devendra 2024년 3월 5일
답변: the cyclist 2024년 3월 6일
Error using classreg.regr.TermsRegression.createFormula
The terms matrix must have one column for each variable in the dataset or table. You may not
specify the response as a separate vector with a dataset or table.
Error in LinearModel.createFormula (line 1076)
formula = classreg.regr.TermsRegression.createFormula(supplied,modelDef, ...
Error in LinearModel.fit (line 1058)
model.Formula = LinearModel.createFormula(supplied,modelDef,X, ...
Error in fitlm (line 122)
model = LinearModel.fit(X,varargin{:});
Error in reg_VI (line 45)
reg = fitlm(X_train,Y_train);
  댓글 수: 3
Walter Roberson
Walter Roberson 2024년 3월 6일
It is possible that Y_train has multiple columns.
the cyclist
the cyclist 2024년 3월 6일
@Devendra, can you upload the X and Y data? (You can use the paper clip icon in the INSERT section of the toolbar.) This would make it vastly easier to help you debug this.

댓글을 달려면 로그인하십시오.

답변 (1개)

the cyclist
the cyclist 2024년 3월 6일
@Walter Roberson surmised correctly, as usual. The fitlm function cannot be used when you have multiple dependent variables.
You may be able to use mvregress. (It won't be a machine learning algorithm, though.)

카테고리

Help CenterFile Exchange에서 Resampling Techniques에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by