필터 지우기
필터 지우기

svmtrain

조회 수: 5 (최근 30일)
Bahareh
Bahareh 2011년 6월 7일
Hello all,
I have two sets of data each of size 3x400. I would like to train them using svmtrain but I don't know what I should put for group. Can you please help me? can you also let me know what should I put for group if I get data with arbitrary sizes? thanks.

채택된 답변

Walter Roberson
Walter Roberson 2011년 6월 7일
Each data sample must belong to a pre-known group for the purpose of svmtrain. The grouping variable is a list of which group each sample belongs to.
Do you have 3 features or 400 features? Are your two data sets indicating exactly two different groups, or are there entries from multiple groups within a data set? If your data is already split by groups, then your group variable should be 1 for each member of the first data set and 2 for each member of the second data set.
  댓글 수: 2
Bahareh
Bahareh 2011년 6월 7일
I have 3 features with 400 observations and each data sets corresponds to one class. so you mean I should use svmtrain for each class separately? i.e. can't I put all my data in one array with size 3x800 and train them?
Walter Roberson
Walter Roberson 2011년 6월 7일
Approximately,
svm( [setA,setB].', [ones(size(setA,2),1);2*ones(size(setB,2),1)] )
That is, the data submitted to svm must be one observation per _row_, so splice the data together and switch from column-oriented to row-oriented. The group variable will be 1 for all of the observations in setA and 2 for all of the observations in setB.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by