I am trying to classify the presence of a car in an image.For this purpose I have downloaded a Dataset containing the images of Cars.I need to know how to split this data-set into training,cross-validation and testing set.How to select which of the images to fall into what category(i.e. Testing Set or Cross Validation Set or Training Set).What is the percentage that I should split up to get the best results.
-
$\begingroup$ Those are hard questions to answer because there is not one fixed way to do it. What program are you using? $\endgroup$– Drew75Commented Feb 17, 2014 at 6:28
-
$\begingroup$ I am using Data-set of car images.from this link.I am trying to classify the presence of bikes.I have obtained features by using the SIFT algorithm.How to split it up (%)? $\endgroup$– logamadiCommented Feb 17, 2014 at 11:26
-
$\begingroup$ Do you want code or do you just want to know the %? Can you tell us the size of the dataset (how many observations)? $\endgroup$– Drew75Commented Feb 17, 2014 at 18:24
-
$\begingroup$ @Drew75 I am using Weka toolbox for training the SVM-classifier.There are around 420 positive images containing cars and around 240 images (negative samples).Now how to split them into training and testing set?Regards and thanks a lot. $\endgroup$– logamadiCommented Feb 17, 2014 at 18:31
1 Answer
There is no correct percentage for training/test split. Common ratios are 80/20 and 70/30. Basically, you want to have a higher proportion in the training test in order to correctly ajust the model, then a smaller percentage to test on.
An important note is that the split should be random. Take 70% of your data randomly from the whole dataset, so to avoid bias in the sample. You can also sample the two categories separately (70% of the negative, 70% of the positives) to keep the same ratio between the positive/negatives.
I don't know Weka toolbox, so I can't give you the code. Any statistical software should allow for a random sample.
Side Note: with your sample size you could consider cross-validation or bootstrapping rather than training/test sampling.
-
$\begingroup$ Wont the evaluation measurements be different each time if the test data is picked out randomly ? $\endgroup$– KenciCommented May 26, 2015 at 17:09