Effacer les filtres
Effacer les filtres

Best way to split data into random partitions?

8 vues (au cours des 30 derniers jours)
G. Nardi
G. Nardi le 11 Jan 2019
Commenté : G. Nardi le 12 Jan 2019
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

Réponse acceptée

Cris LaPierre
Cris LaPierre le 12 Jan 2019
Modifié(e) : Cris LaPierre le 12 Jan 2019
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 commentaires
David Goodmanson
David Goodmanson le 12 Jan 2019
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 le 12 Jan 2019
thanks! i appreciate it.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Tags

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by