splitting dataset into training set and testing set
Afficher commentaires plus anciens
I have 400 images in my dataset(images).I want to split the dataset into 80% for training and 20% for testing.the below attached code works but , test_idx is empty?why?
train_idx contains 320 images.test_idx is empty.
clc
clear
% Load Image dataset
faceDatabase = imageSet('facedatabaseatt','recursive');
%splitting into training and testing sets
N = 400; % number of images
idx = 1:N ;
PD = 0.80 ;
train_idx = idx(1:round(PD*N)); % training indices
test_idx = idx(round(PD*N)+1:end,:) ; % test indices
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Semantic Segmentation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
