How to Split data into 3 equal parts (A,B,C) with balanced numbers of each subclass.

1 visualización (últimos 30 días)
Hi,
I have a dataset and I can split it into 3 parts but I do not know how to make sure that these 3 parts are with balanced numbers of each subclass.

Respuestas (1)

the cyclist
the cyclist el 6 de Mzo. de 2021
Probably the easiest way to do this would be with the following steps:
  1. Isolate each of the classes, using something like "Y == A" (this is pseudocode, not MATLAB syntax), etc
  2. Randomly assign each class to your groups (training and testing, whatever)
  3. Combine the classes into the groups
If you upload the data -- or at the very least describe in detail what your data look like -- I could probably give more specific advice with actual code.
  1 comentario
Xue Zhang
Xue Zhang el 6 de Mzo. de 2021
Thanks,that's my first idea too. The data is 2400 images with 24 subclass. And I also need to do the cross validation to these.

Iniciar sesión para comentar.

Categorías

Más información sobre Data Type Identification en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by