Appropriate data format for fitcsvm() function

조회 수: 4 (최근 30일)
Saugata Bose
Saugata Bose 2019년 8월 1일
편집: Saugata Bose 2019년 8월 2일
Hi
Im a trying to design a svm classifier. Doing this, I stuck at a point where I am getting an error during applying fitcsm(). I understand that, the error arises due to the mismatch of the appropriate data format. Would you please help me to sort out the issue?
Input:
I have 2000 train data of format '1 x 20 x 300 dimension single' which is X where as the category data for train is of 2000 x 1 dimension which is Y.
Data Format:
The data format of X{2000 X 1} is following
Each cell contains data of dimension 1 x 20 x 300 such as the following:
where as Y contains categorical data of 2000 x 1.
After applying fitcsvm(X, Y) the following error has arisen:
Invalid data type. X must be a double or single matrix.
Would you please suggest me the appropriate way to make fitcsvm() working?
thanks,
  댓글 수: 2
the cyclist
the cyclist 2019년 8월 1일
If you have 2000 Y data (size = [2000,1] as you say), then I would expect your X data to have size [2000,N], where N is the number of features in your feature set. I don't understand how a [1,20,300] array -- which has 6000 elements -- translates into the size you need.
Saugata Bose
Saugata Bose 2019년 8월 2일
편집: Saugata Bose 2019년 8월 2일
@the cyclist:
Sorry for the delayed response. Actually, after preprocessing X it turns into a coplex dimension(I believe). Each X is of dimension '1 x 20 x 300 single'. I found that, fitcsvm expects X either be a table format or a single/double format. Here, I got stuck that how could i change the dimension in either table format or in single/doble format. After getting your reply, I have tried to elaborate my query by adding few images in the updated question as well.

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by