Undefined function 'predict' for input arguments of type 'classreg.​learning.p​artition.R​egressionP​artitioned​Linear'.

7 visualizaciones (últimos 30 días)
After training model with cross validation:
model{i}=fitrlinear(xtrain',ytrain(i,:)','Crossval','on');
I try to use predict function
predict(model{i},xtest);
This worked fine when i didn't have cross validation flags in the fitrlinear function because the output was linear regression model. I looked on wiki for RegressionPartionedLinear object and its function is also called predict, but matlab giving me "undefined function" error.
How can I use the cross validated model?

Respuesta aceptada

Image Analyst
Image Analyst el 10 de Ag. de 2020
What does this say
>> which -all predict
Also if you run the attached program, what does it say?
  3 comentarios
Image Analyst
Image Analyst el 11 de Ag. de 2020
I think that looks okay. So we can debug further, attach xtrain, and ytrain in a .mat file
save('answers.mat', 'xtrain', 'ytrain');
and your script.
Akira Kato
Akira Kato el 11 de Ag. de 2020
I tried it again and it didn't throw me error, the models were not objects RegressionPartionedLinear but just Regression Linear objects for some reason. I honestly don't know what the difference between yesterday and today is, maybe RegressionPartionedLinear is intermediate object? idk. Thanks for your help and patience. If there's anything that comes up again with the same problem ill just continue this thread.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre System Composer en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by