필터 지우기
필터 지우기

Predict response given new input data | GLME

조회 수: 3 (최근 30일)
Joel
Joel 2018년 10월 11일
댓글: Joel 2018년 10월 11일
I am trying to fit a model between a dependent variable (Y) and two predictor variables (X, Z) using GLME.
First I divided the data into training (80%) and validation (20%). I've fitted a GLME model to the training data:
X = Xtr % Validation portion of data (442x1);
Z = Ztr % Validation portion of data (442x1);
Y = Ytr % Validation portion of data (442x1);
trTable = table(Y,X,Z);
mdl_glme = fitglme(trTable,'Y ~ X + (1 | Z) + (-1 + X | Z)')'
Now I want to test this model on new (validation) data. This is where I run into problems. If I try:
X = Xval % Validation portion of data (110x1);
Z = Zval % Validation portion of data (110x1);
Y = Yval % Validation portion of data (110x1);
valTable = table(Y,X,Z);
ypred = predict(mdl_glme,valTable)
I get the following error:
Error using categorical (line 434)
Unable to create default category names. Specify category names using the CATEGORYNAMES
input argument.
Error in nominal (line 152)
b = b@categorical(a,args{:},'Ordinal',false);
Error in classreg.regr.LinearLikeMixedModel/makeInteractionVar (line 806)
G = nominal(ds.(interactionVars{1}));
Error in classreg.regr.LinearLikeMixedModel/extractGroupingInfo (line 205)
model.makeInteractionVar(ds,interactionVars);
Error in GeneralizedLinearMixedModel/predict (line 539)
ginfo = extractGroupingInfo(model,ds);
Though if I inspect trTable and valTable the only difference I can see is the number of rows:
442×3 table (trTable)
Y X Z
_________ _________ ________
1.2107 1.2011 0.098847
110×3 table (valTable)
Y X Z
_________ _________ ______
1.6064 1.6024 1.6024
I would be very grateful for any feedback and/or advice.
Regards J
  댓글 수: 2
the cyclist
the cyclist 2018년 10월 11일
Can you upload your dataset, or a minimal subset that exhibits the problem?
(Sometimes trying to find the minimal subset that causes the problem will actually help identify the cause.)
Joel
Joel 2018년 10월 11일
Thanks! I really appreciate it! I will upload it first thing tomorrow morning as I do not have access to it at the moment (home computer).
Regards J

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by