View source: R/deepSelection.r
train_test_split | R Documentation |
Split data into random train and test subsets.
train_test_split(
...,
test_size = NULL,
train_size = NULL,
random_state = NULL,
shuffle = TRUE
)
... |
Sequence of data. |
test_size |
An integer or float value between 0.0 and 1.0 representing the absolute number of test samples (integer) or the proportion of the data to include in the test split (float).
If |
train_size |
An integer or float value between 0.0 and 1.0 representing the absolute number of train samples (integer) or the proportion of the data to include in the train split (float).
If |
random_state |
Controls the shuffling applied to the data before applying the split. Pass an int for reproducible output across multiple function calls. |
shuffle |
Whether or not to shuffle the data before splitting. |
List containing train-test split of inputs.
library(marray)
df <- data.frame(rating = factor(sample(c("low", "medium", "high") -> lvls, size = 100, replace = T), levels = lvls),
personality = sample(30, size = 100, replace = T),
motivation = runif(100, min = 0, max = 100))
a <- marray(1:24, dim = c(4, 3, 2))
m <- marray(1:24, dim = c(6, 4))
train_test_split(df, a, m)
df <- data.frame(y = 1:20, x1 = 1:20, x2 = 1:20)
X <- marray(df[c("x1", "x2")])
y <- marray(df[c("y")])
train_test_split(X, y, random_state = 0, shuffle = T)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.