RegressionTree cannot use "predict" method?
이전 댓글 표시
Hello there,
I'm using Matlab R2013a and was able to train a regression tree using RegressionTree.fit(). However, when I used "predict(rtree, test_data)," I got the following error message:
Error using predict (line 85) Systems of classreg.learning.partition.RegressionPartitionedModel class cannot be used with the "predict" command. Convert the system to an identified model first, such as by using the "idss" command.
I believe using "predict" method confused a dynamic model estimation. Can you please tell me what was wrong?
Young
답변 (2개)
Young
2014년 6월 9일
편집: Walter Roberson
2016년 4월 12일
댓글 수: 1
reem aldaihani
2018년 2월 17일
What if we will use cross-validation? This is part of my code: cvmodel=fitcknn(training_Best,class1, 'Distance',@mindistnew, 'NumNeighbors',1, 'KFold',10); cvclass=predict(cvmodel, testing_Best);
and I received this error:
Systems of classreg.learning.partition.ClassificationPartitionedModel class cannot be used with the "predict" command. Convert the system to an identified model first, such as by using the "idss" command.
Could you please help me to fix this ASAP.
Sincloe Brans
2014년 6월 9일
편집: Walter Roberson
2016년 4월 11일
Just do
Yfit = tree([Xnew]);
where tree is your regression or classreg tree and Xnew the new X's to be predicted.
카테고리
도움말 센터 및 File Exchange에서 Gaussian Process Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!