Why immse function is giving error?

조회 수: 6 (최근 30일)
Sanchit
Sanchit 2023년 7월 9일
댓글: Sanchit 2023년 7월 9일
I am getting following error while using immse function for computing mean square error
Error using immse
Expected input number 1, A, to be one of these types:
uint8, int8, uint16, int16, uint32, int32, single, double
Instead its type was table.
Error in immse (line 28)
I am attaching the matlab code along with input file. Please suggest me how to fix this error.
Sanchit
  댓글 수: 1
Sanchit
Sanchit 2023년 7월 9일
% Create a Random Forest classifier
rf_classifier = TreeBagger(100, X_train, y_train, 'OOBPrediction', 'On');
predicted = predict(rf_classifier, X_train);
oob_mse = immse(y_train, predicted);
disp(sprintf('Out-of-Bag Mean Square Error: %.4f', oob_mse(end)));
I am getting following error while using immse function for computing mean square error
Error using immse
Expected input number 1, A, to be one of these types:
uint8, int8, uint16, int16, uint32, int32, single, double
Instead its type was table.
Error in immse (line 28)
I am attaching the matlab code along with input file. Please suggest me how to fix this error.
Sanchit

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

답변 (1개)

Prasannavenkatesh
Prasannavenkatesh 2023년 7월 9일
Hi Sanchit,
The error message indicates that the input argument expected by the "immse" function is not of the correct data type. In this case, the error message suggests that the input argument is a table data type, which is not one of the supported data types for the "immse" function. The "immse" function only supports data types such as uint8, int8, uint16, int16, uint32, int32, single, and double.
To resolve this error, you need to make sure that the input argument is of one of the supported data types. Convert the input argument to one of the data types supported by the immse function to solve the error.

카테고리

Help CenterFile Exchange에서 Classification Ensembles에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by