How to adapt data sizes using createDataPartition ()

I have a question about transferring data to a train, testing and validation using createDataPartition (). I found a solution that is ideal for sharing 60, 20, 20. However, I see no way to adapt my data sharing with it and still make sure that my data does not overlap. Ie, I would like to split into 80, 10, 10 or something else.

    library("caret")
    # Draw a random, stratified sample including p percent of the data    
    idx.train <- createDataPartition(y = iris$Species, p = 0.8, list = FALSE) 
    # training set with p = 0.8
    train <- iris[idx.train, ] 
    # test set with p = 0.2 (drop all observations with train indeces)
    test <-  iris[-idx.train, ] 
    # Draw a random, stratified sample of ratio p of the data
    idx.validation <- createDataPartition(y = train$Species, p = 0.25, list = FALSE) 
    #validation set with p = 0.8*0.25 = 0.2
    validation <- train[idx.validation, ] 
    #final train set with p= 0.8*0.75 = 0.6
    train60 <- train[-idx.validation, ] 
0
source share

All Articles