Undefined function 'predict' for input arguments of type 'table'.

조회 수: 14 (최근 30일)
Patrick Schulz
Patrick Schulz 2018년 3월 19일
댓글: Steven Lord 2018년 3월 20일
predict(RUSBoostedTreeModel,X) gives the error "Undefined function 'predict' for input arguments of type 'table'". The documentation https://nl.mathworks.com/help/stats/compactclassificationensemble.predict.html says that X can be a table. What could be the issue? X is of the same format as the data the model was trained on.

채택된 답변

Steven Lord
Steven Lord 2018년 3월 19일
Which release of Statistics and Machine Learning Toolbox are you using?
Does the documentation for the predict function in your installation say that the second input can be a table? The online documentation is for the most recent release and so may describe functionality introduced in a later release than you have installed. Your locally installed documentation will describe the functionality you actually have installed.
  댓글 수: 6
Patrick Schulz
Patrick Schulz 2018년 3월 20일
편집: Patrick Schulz 2018년 3월 20일
ans = 'struct'
edit
Found and answer by using
Model.HowToPredict
'To make predictions on a new table, T, use:
yfit = c.predictFcn(T)
Steven Lord
Steven Lord 2018년 3월 20일
That makes sense. There's no predict method on either the struct or table classes, so MATLAB doesn't know what to run when you call predict. The error mentions table rather than struct because table is a dominant class to struct.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by