필터 지우기
필터 지우기

Best way to split data into random partitions?

조회 수: 8 (최근 30일)
G. Nardi
G. Nardi 2019년 1월 11일
댓글: G. Nardi 2019년 1월 12일
I am new to Matlab and still a student. For an assignment, I am stuck on this part.
Create 5 random partitions of the data, splitting each of the classes into 60% training and 40% testing.
I have two classes, Class One and Class Two.
How would I be able to do this?
classOne and classTwo is 10000x2 double histogram

채택된 답변

Cris LaPierre
Cris LaPierre 2019년 1월 12일
편집: Cris LaPierre 2019년 1월 12일
I would use the dividerand function in the Deep Learning Toolbox.
For example
[trainInd,valInd,testInd] = dividerand(3000,0.6,0.2,0.2);
Just set the validation percentage to 0 if you don't need it.
  댓글 수: 5
David Goodmanson
David Goodmanson 2019년 1월 12일
HI Masaki,
Neither do I, but you can use somthing more basic like RandInd = randperm(n), which creates a vector containing a random arrangement of the numbers 1:n. Then you can take the first 60% (or whatever) of RandInd to be TrainInd, etc. and proceed from there.
G. Nardi
G. Nardi 2019년 1월 12일
thanks! i appreciate it.

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by