Undefined function 'predict' for input arguments of type 'classreg.learning.partition.RegressionPartitionedLinear'.
11 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
Image Analyst
2020-8-10
What does this say
>> which -all predict
Also if you run the attached program, what does it say?
3 个评论
Image Analyst
2020-8-11
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.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!