Creates a training and a test set based on a dataframe. Can also be stratified (i.e., evenly spread a given factor) using the group argument.

data_partition(data, training_proportion = 0.7, group = NULL, seed = NULL, ...)

Arguments

data

A data frame, or an object that can be coerced to a data frame.

training_proportion

The proportion (between 0 and 1) of the training set. The remaining part will be used for the test set.

group

A character vector indicating the name(s) of the column(s) used for stratified partitioning.

seed

A random number generator seed. Enter an integer (e.g. 123) so that the random sampling will be the same each time you run the function.

...

Other arguments passed to or from other functions.

Value

A list of two data frames, named test and training.

Examples

df <- iris
df$Smell <- rep(c("Strong", "Light"), 75)

data_partition(df)
#> $training
#>     Sepal.Length Sepal.Width Petal.Length Petal.Width    Species  Smell
#> 116          6.4         3.2          5.3         2.3  virginica  Light
#> 149          6.2         3.4          5.4         2.3  virginica Strong
#> 49           5.3         3.7          1.5         0.2     setosa Strong
#> 93           5.8         2.6          4.0         1.2 versicolor Strong
#> 27           5.0         3.4          1.6         0.4     setosa Strong
#> 57           6.3         3.3          4.7         1.6 versicolor Strong
#> 17           5.4         3.9          1.3         0.4     setosa Strong
#> 6            5.4         3.9          1.7         0.4     setosa  Light
#> 135          6.1         2.6          5.6         1.4  virginica Strong
#> 83           5.8         2.7          3.9         1.2 versicolor Strong
#> 105          6.5         3.0          5.8         2.2  virginica Strong
#> 70           5.6         2.5          3.9         1.1 versicolor  Light
#> 21           5.4         3.4          1.7         0.2     setosa Strong
#> 103          7.1         3.0          5.9         2.1  virginica Strong
#> 34           5.5         4.2          1.4         0.2     setosa  Light
#> 112          6.4         2.7          5.3         1.9  virginica  Light
#> 54           5.5         2.3          4.0         1.3 versicolor  Light
#> 8            5.0         3.4          1.5         0.2     setosa  Light
#> 127          6.2         2.8          4.8         1.8  virginica Strong
#> 125          6.7         3.3          5.7         2.1  virginica Strong
#> 120          6.0         2.2          5.0         1.5  virginica  Light
#> 99           5.1         2.5          3.0         1.1 versicolor Strong
#> 148          6.5         3.0          5.2         2.0  virginica  Light
#> 128          6.1         3.0          4.9         1.8  virginica  Light
#> 9            4.4         2.9          1.4         0.2     setosa Strong
#> 101          6.3         3.3          6.0         2.5  virginica Strong
#> 85           5.4         3.0          4.5         1.5 versicolor Strong
#> 77           6.8         2.8          4.8         1.4 versicolor Strong
#> 124          6.3         2.7          4.9         1.8  virginica  Light
#> 30           4.7         3.2          1.6         0.2     setosa  Light
#> 74           6.1         2.8          4.7         1.2 versicolor  Light
#> 64           6.1         2.9          4.7         1.4 versicolor  Light
#> 91           5.5         2.6          4.4         1.2 versicolor Strong
#> 5            5.0         3.6          1.4         0.2     setosa Strong
#> 121          6.9         3.2          5.7         2.3  virginica Strong
#> 61           5.0         2.0          3.5         1.0 versicolor Strong
#> 1            5.1         3.5          1.4         0.2     setosa Strong
#> 132          7.9         3.8          6.4         2.0  virginica  Light
#> 92           6.1         3.0          4.6         1.4 versicolor  Light
#> 7            4.6         3.4          1.4         0.3     setosa Strong
#> 58           4.9         2.4          3.3         1.0 versicolor  Light
#> 4            4.6         3.1          1.5         0.2     setosa  Light
#> 139          6.0         3.0          4.8         1.8  virginica Strong
#> 44           5.0         3.5          1.6         0.6     setosa  Light
#> 40           5.1         3.4          1.5         0.2     setosa  Light
#> 89           5.6         3.0          4.1         1.3 versicolor Strong
#> 62           5.9         3.0          4.2         1.5 versicolor  Light
#> 66           6.7         3.1          4.4         1.4 versicolor  Light
#> 31           4.8         3.1          1.6         0.2     setosa Strong
#> 33           5.2         4.1          1.5         0.1     setosa Strong
#> 42           4.5         2.3          1.3         0.3     setosa  Light
#> 141          6.7         3.1          5.6         2.4  virginica Strong
#> 51           7.0         3.2          4.7         1.4 versicolor Strong
#> 68           5.8         2.7          4.1         1.0 versicolor  Light
#> 90           5.5         2.5          4.0         1.3 versicolor  Light
#> 95           5.6         2.7          4.2         1.3 versicolor Strong
#> 3            4.7         3.2          1.3         0.2     setosa Strong
#> 63           6.0         2.2          4.0         1.0 versicolor Strong
#> 94           5.0         2.3          3.3         1.0 versicolor  Light
#> 126          7.2         3.2          6.0         1.8  virginica  Light
#> 24           5.1         3.3          1.7         0.5     setosa  Light
#> 35           4.9         3.1          1.5         0.2     setosa Strong
#> 48           4.6         3.2          1.4         0.2     setosa  Light
#> 100          5.7         2.8          4.1         1.3 versicolor  Light
#> 129          6.4         2.8          5.6         2.1  virginica Strong
#> 97           5.7         2.9          4.2         1.3 versicolor Strong
#> 43           4.4         3.2          1.3         0.2     setosa Strong
#> 11           5.4         3.7          1.5         0.2     setosa Strong
#> 87           6.7         3.1          4.7         1.5 versicolor Strong
#> 67           5.6         3.0          4.5         1.5 versicolor Strong
#> 25           4.8         3.4          1.9         0.2     setosa Strong
#> 81           5.5         2.4          3.8         1.1 versicolor Strong
#> 143          5.8         2.7          5.1         1.9  virginica Strong
#> 118          7.7         3.8          6.7         2.2  virginica  Light
#> 73           6.3         2.5          4.9         1.5 versicolor Strong
#> 19           5.7         3.8          1.7         0.3     setosa Strong
#> 110          7.2         3.6          6.1         2.5  virginica  Light
#> 80           5.7         2.6          3.5         1.0 versicolor  Light
#> 41           5.0         3.5          1.3         0.3     setosa Strong
#> 32           5.4         3.4          1.5         0.4     setosa  Light
#> 71           5.9         3.2          4.8         1.8 versicolor Strong
#> 106          7.6         3.0          6.6         2.1  virginica  Light
#> 28           5.2         3.5          1.5         0.2     setosa  Light
#> 53           6.9         3.1          4.9         1.5 versicolor Strong
#> 150          5.9         3.0          5.1         1.8  virginica  Light
#> 140          6.9         3.1          5.4         2.1  virginica  Light
#> 39           4.4         3.0          1.3         0.2     setosa Strong
#> 78           6.7         3.0          5.0         1.7 versicolor  Light
#> 104          6.3         2.9          5.6         1.8  virginica  Light
#> 46           4.8         3.0          1.4         0.3     setosa  Light
#> 69           6.2         2.2          4.5         1.5 versicolor Strong
#> 10           4.9         3.1          1.5         0.1     setosa  Light
#> 36           5.0         3.2          1.2         0.2     setosa  Light
#> 147          6.3         2.5          5.0         1.9  virginica Strong
#> 123          7.7         2.8          6.7         2.0  virginica Strong
#> 26           5.0         3.0          1.6         0.2     setosa  Light
#> 47           5.1         3.8          1.6         0.2     setosa Strong
#> 133          6.4         2.8          5.6         2.2  virginica Strong
#> 114          5.7         2.5          5.0         2.0  virginica  Light
#> 20           5.1         3.8          1.5         0.3     setosa  Light
#> 22           5.1         3.7          1.5         0.4     setosa  Light
#> 102          5.8         2.7          5.1         1.9  virginica  Light
#> 84           6.0         2.7          5.1         1.6 versicolor  Light
#> 113          6.8         3.0          5.5         2.1  virginica Strong
#> 108          7.3         2.9          6.3         1.8  virginica  Light
#> 
#> $test
#>     Sepal.Length Sepal.Width Petal.Length Petal.Width    Species  Smell
#> 2            4.9         3.0          1.4         0.2     setosa  Light
#> 12           4.8         3.4          1.6         0.2     setosa  Light
#> 13           4.8         3.0          1.4         0.1     setosa Strong
#> 14           4.3         3.0          1.1         0.1     setosa  Light
#> 15           5.8         4.0          1.2         0.2     setosa Strong
#> 16           5.7         4.4          1.5         0.4     setosa  Light
#> 18           5.1         3.5          1.4         0.3     setosa  Light
#> 23           4.6         3.6          1.0         0.2     setosa Strong
#> 29           5.2         3.4          1.4         0.2     setosa Strong
#> 37           5.5         3.5          1.3         0.2     setosa Strong
#> 38           4.9         3.6          1.4         0.1     setosa  Light
#> 45           5.1         3.8          1.9         0.4     setosa Strong
#> 50           5.0         3.3          1.4         0.2     setosa  Light
#> 52           6.4         3.2          4.5         1.5 versicolor  Light
#> 55           6.5         2.8          4.6         1.5 versicolor Strong
#> 56           5.7         2.8          4.5         1.3 versicolor  Light
#> 59           6.6         2.9          4.6         1.3 versicolor Strong
#> 60           5.2         2.7          3.9         1.4 versicolor  Light
#> 65           5.6         2.9          3.6         1.3 versicolor Strong
#> 72           6.1         2.8          4.0         1.3 versicolor  Light
#> 75           6.4         2.9          4.3         1.3 versicolor Strong
#> 76           6.6         3.0          4.4         1.4 versicolor  Light
#> 79           6.0         2.9          4.5         1.5 versicolor Strong
#> 82           5.5         2.4          3.7         1.0 versicolor  Light
#> 86           6.0         3.4          4.5         1.6 versicolor  Light
#> 88           6.3         2.3          4.4         1.3 versicolor  Light
#> 96           5.7         3.0          4.2         1.2 versicolor  Light
#> 98           6.2         2.9          4.3         1.3 versicolor  Light
#> 107          4.9         2.5          4.5         1.7  virginica Strong
#> 109          6.7         2.5          5.8         1.8  virginica Strong
#> 111          6.5         3.2          5.1         2.0  virginica Strong
#> 115          5.8         2.8          5.1         2.4  virginica Strong
#> 117          6.5         3.0          5.5         1.8  virginica Strong
#> 119          7.7         2.6          6.9         2.3  virginica Strong
#> 122          5.6         2.8          4.9         2.0  virginica  Light
#> 130          7.2         3.0          5.8         1.6  virginica  Light
#> 131          7.4         2.8          6.1         1.9  virginica Strong
#> 134          6.3         2.8          5.1         1.5  virginica  Light
#> 136          7.7         3.0          6.1         2.3  virginica  Light
#> 137          6.3         3.4          5.6         2.4  virginica Strong
#> 138          6.4         3.1          5.5         1.8  virginica  Light
#> 142          6.9         3.1          5.1         2.3  virginica  Light
#> 144          6.8         3.2          5.9         2.3  virginica  Light
#> 145          6.7         3.3          5.7         2.5  virginica Strong
#> 146          6.7         3.0          5.2         2.3  virginica  Light
#> 
data_partition(df, group = "Species")
#> $training
#>     Sepal.Length Sepal.Width Petal.Length Petal.Width    Species  Smell
#> 2            4.9         3.0          1.4         0.2     setosa  Light
#> 37           5.5         3.5          1.3         0.2     setosa Strong
#> 38           4.9         3.6          1.4         0.1     setosa  Light
#> 34           5.5         4.2          1.4         0.2     setosa  Light
#> 5            5.0         3.6          1.4         0.2     setosa Strong
#> 4            4.6         3.1          1.5         0.2     setosa  Light
#> 47           5.1         3.8          1.6         0.2     setosa Strong
#> 7            4.6         3.4          1.4         0.3     setosa Strong
#> 44           5.0         3.5          1.6         0.6     setosa  Light
#> 9            4.4         2.9          1.4         0.2     setosa Strong
#> 1            5.1         3.5          1.4         0.2     setosa Strong
#> 3            4.7         3.2          1.3         0.2     setosa Strong
#> 6            5.4         3.9          1.7         0.4     setosa  Light
#> 27           5.0         3.4          1.6         0.4     setosa Strong
#> 32           5.4         3.4          1.5         0.4     setosa  Light
#> 11           5.4         3.7          1.5         0.2     setosa Strong
#> 31           4.8         3.1          1.6         0.2     setosa Strong
#> 48           4.6         3.2          1.4         0.2     setosa  Light
#> 42           4.5         2.3          1.3         0.3     setosa  Light
#> 17           5.4         3.9          1.3         0.4     setosa Strong
#> 46           4.8         3.0          1.4         0.3     setosa  Light
#> 26           5.0         3.0          1.6         0.2     setosa  Light
#> 19           5.7         3.8          1.7         0.3     setosa Strong
#> 43           4.4         3.2          1.3         0.2     setosa Strong
#> 30           4.7         3.2          1.6         0.2     setosa  Light
#> 36           5.0         3.2          1.2         0.2     setosa  Light
#> 33           5.2         4.1          1.5         0.1     setosa Strong
#> 14           4.3         3.0          1.1         0.1     setosa  Light
#> 24           5.1         3.3          1.7         0.5     setosa  Light
#> 40           5.1         3.4          1.5         0.2     setosa  Light
#> 39           4.4         3.0          1.3         0.2     setosa Strong
#> 21           5.4         3.4          1.7         0.2     setosa Strong
#> 23           4.6         3.6          1.0         0.2     setosa Strong
#> 29           5.2         3.4          1.4         0.2     setosa Strong
#> 18           5.1         3.5          1.4         0.3     setosa  Light
#> 99           5.1         2.5          3.0         1.1 versicolor Strong
#> 86           6.0         3.4          4.5         1.6 versicolor  Light
#> 88           6.3         2.3          4.4         1.3 versicolor  Light
#> 80           5.7         2.6          3.5         1.0 versicolor  Light
#> 61           5.0         2.0          3.5         1.0 versicolor Strong
#> 67           5.6         3.0          4.5         1.5 versicolor Strong
#> 75           6.4         2.9          4.3         1.3 versicolor Strong
#> 58           4.9         2.4          3.3         1.0 versicolor  Light
#> 93           5.8         2.6          4.0         1.2 versicolor Strong
#> 83           5.8         2.7          3.9         1.2 versicolor Strong
#> 54           5.5         2.3          4.0         1.3 versicolor  Light
#> 96           5.7         3.0          4.2         1.2 versicolor  Light
#> 51           7.0         3.2          4.7         1.4 versicolor Strong
#> 90           5.5         2.5          4.0         1.3 versicolor  Light
#> 82           5.5         2.4          3.7         1.0 versicolor  Light
#> 59           6.6         2.9          4.6         1.3 versicolor Strong
#> 81           5.5         2.4          3.8         1.1 versicolor Strong
#> 62           5.9         3.0          4.2         1.5 versicolor  Light
#> 94           5.0         2.3          3.3         1.0 versicolor  Light
#> 91           5.5         2.6          4.4         1.2 versicolor Strong
#> 71           5.9         3.2          4.8         1.8 versicolor Strong
#> 68           5.8         2.7          4.1         1.0 versicolor  Light
#> 98           6.2         2.9          4.3         1.3 versicolor  Light
#> 100          5.7         2.8          4.1         1.3 versicolor  Light
#> 63           6.0         2.2          4.0         1.0 versicolor Strong
#> 92           6.1         3.0          4.6         1.4 versicolor  Light
#> 97           5.7         2.9          4.2         1.3 versicolor Strong
#> 69           6.2         2.2          4.5         1.5 versicolor Strong
#> 65           5.6         2.9          3.6         1.3 versicolor Strong
#> 64           6.1         2.9          4.7         1.4 versicolor  Light
#> 57           6.3         3.3          4.7         1.6 versicolor Strong
#> 52           6.4         3.2          4.5         1.5 versicolor  Light
#> 77           6.8         2.8          4.8         1.4 versicolor Strong
#> 78           6.7         3.0          5.0         1.7 versicolor  Light
#> 89           5.6         3.0          4.1         1.3 versicolor Strong
#> 106          7.6         3.0          6.6         2.1  virginica  Light
#> 119          7.7         2.6          6.9         2.3  virginica Strong
#> 138          6.4         3.1          5.5         1.8  virginica  Light
#> 133          6.4         2.8          5.6         2.2  virginica Strong
#> 126          7.2         3.2          6.0         1.8  virginica  Light
#> 124          6.3         2.7          4.9         1.8  virginica  Light
#> 107          4.9         2.5          4.5         1.7  virginica Strong
#> 141          6.7         3.1          5.6         2.4  virginica Strong
#> 120          6.0         2.2          5.0         1.5  virginica  Light
#> 147          6.3         2.5          5.0         1.9  virginica Strong
#> 104          6.3         2.9          5.6         1.8  virginica  Light
#> 129          6.4         2.8          5.6         2.1  virginica Strong
#> 128          6.1         3.0          4.9         1.8  virginica  Light
#> 105          6.5         3.0          5.8         2.2  virginica Strong
#> 137          6.3         3.4          5.6         2.4  virginica Strong
#> 113          6.8         3.0          5.5         2.1  virginica Strong
#> 149          6.2         3.4          5.4         2.3  virginica Strong
#> 122          5.6         2.8          4.9         2.0  virginica  Light
#> 101          6.3         3.3          6.0         2.5  virginica Strong
#> 111          6.5         3.2          5.1         2.0  virginica Strong
#> 143          5.8         2.7          5.1         1.9  virginica Strong
#> 103          7.1         3.0          5.9         2.1  virginica Strong
#> 145          6.7         3.3          5.7         2.5  virginica Strong
#> 115          5.8         2.8          5.1         2.4  virginica Strong
#> 117          6.5         3.0          5.5         1.8  virginica Strong
#> 109          6.7         2.5          5.8         1.8  virginica Strong
#> 150          5.9         3.0          5.1         1.8  virginica  Light
#> 130          7.2         3.0          5.8         1.6  virginica  Light
#> 146          6.7         3.0          5.2         2.3  virginica  Light
#> 110          7.2         3.6          6.1         2.5  virginica  Light
#> 116          6.4         3.2          5.3         2.3  virginica  Light
#> 114          5.7         2.5          5.0         2.0  virginica  Light
#> 118          7.7         3.8          6.7         2.2  virginica  Light
#> 127          6.2         2.8          4.8         1.8  virginica Strong
#> 144          6.8         3.2          5.9         2.3  virginica  Light
#> 
#> $test
#>     Sepal.Length Sepal.Width Petal.Length Petal.Width    Species  Smell
#> 8            5.0         3.4          1.5         0.2     setosa  Light
#> 10           4.9         3.1          1.5         0.1     setosa  Light
#> 12           4.8         3.4          1.6         0.2     setosa  Light
#> 13           4.8         3.0          1.4         0.1     setosa Strong
#> 15           5.8         4.0          1.2         0.2     setosa Strong
#> 16           5.7         4.4          1.5         0.4     setosa  Light
#> 20           5.1         3.8          1.5         0.3     setosa  Light
#> 22           5.1         3.7          1.5         0.4     setosa  Light
#> 25           4.8         3.4          1.9         0.2     setosa Strong
#> 28           5.2         3.5          1.5         0.2     setosa  Light
#> 35           4.9         3.1          1.5         0.2     setosa Strong
#> 41           5.0         3.5          1.3         0.3     setosa Strong
#> 45           5.1         3.8          1.9         0.4     setosa Strong
#> 49           5.3         3.7          1.5         0.2     setosa Strong
#> 50           5.0         3.3          1.4         0.2     setosa  Light
#> 53           6.9         3.1          4.9         1.5 versicolor Strong
#> 55           6.5         2.8          4.6         1.5 versicolor Strong
#> 56           5.7         2.8          4.5         1.3 versicolor  Light
#> 60           5.2         2.7          3.9         1.4 versicolor  Light
#> 66           6.7         3.1          4.4         1.4 versicolor  Light
#> 70           5.6         2.5          3.9         1.1 versicolor  Light
#> 72           6.1         2.8          4.0         1.3 versicolor  Light
#> 73           6.3         2.5          4.9         1.5 versicolor Strong
#> 74           6.1         2.8          4.7         1.2 versicolor  Light
#> 76           6.6         3.0          4.4         1.4 versicolor  Light
#> 79           6.0         2.9          4.5         1.5 versicolor Strong
#> 84           6.0         2.7          5.1         1.6 versicolor  Light
#> 85           5.4         3.0          4.5         1.5 versicolor Strong
#> 87           6.7         3.1          4.7         1.5 versicolor Strong
#> 95           5.6         2.7          4.2         1.3 versicolor Strong
#> 102          5.8         2.7          5.1         1.9  virginica  Light
#> 108          7.3         2.9          6.3         1.8  virginica  Light
#> 112          6.4         2.7          5.3         1.9  virginica  Light
#> 121          6.9         3.2          5.7         2.3  virginica Strong
#> 123          7.7         2.8          6.7         2.0  virginica Strong
#> 125          6.7         3.3          5.7         2.1  virginica Strong
#> 131          7.4         2.8          6.1         1.9  virginica Strong
#> 132          7.9         3.8          6.4         2.0  virginica  Light
#> 134          6.3         2.8          5.1         1.5  virginica  Light
#> 135          6.1         2.6          5.6         1.4  virginica Strong
#> 136          7.7         3.0          6.1         2.3  virginica  Light
#> 139          6.0         3.0          4.8         1.8  virginica Strong
#> 140          6.9         3.1          5.4         2.1  virginica  Light
#> 142          6.9         3.1          5.1         2.3  virginica  Light
#> 148          6.5         3.0          5.2         2.0  virginica  Light
#> 
data_partition(df, group = c("Species", "Smell"))
#> $training
#>     Sepal.Length Sepal.Width Petal.Length Petal.Width    Species  Smell
#> 10           4.9         3.1          1.5         0.1     setosa  Light
#> 44           5.0         3.5          1.6         0.6     setosa  Light
#> 42           4.5         2.3          1.3         0.3     setosa  Light
#> 40           5.1         3.4          1.5         0.2     setosa  Light
#> 6            5.4         3.9          1.7         0.4     setosa  Light
#> 12           4.8         3.4          1.6         0.2     setosa  Light
#> 34           5.5         4.2          1.4         0.2     setosa  Light
#> 4            4.6         3.1          1.5         0.2     setosa  Light
#> 18           5.1         3.5          1.4         0.3     setosa  Light
#> 20           5.1         3.8          1.5         0.3     setosa  Light
#> 16           5.7         4.4          1.5         0.4     setosa  Light
#> 24           5.1         3.3          1.7         0.5     setosa  Light
#> 8            5.0         3.4          1.5         0.2     setosa  Light
#> 30           4.7         3.2          1.6         0.2     setosa  Light
#> 38           4.9         3.6          1.4         0.1     setosa  Light
#> 48           4.6         3.2          1.4         0.2     setosa  Light
#> 26           5.0         3.0          1.6         0.2     setosa  Light
#> 56           5.7         2.8          4.5         1.3 versicolor  Light
#> 66           6.7         3.1          4.4         1.4 versicolor  Light
#> 94           5.0         2.3          3.3         1.0 versicolor  Light
#> 60           5.2         2.7          3.9         1.4 versicolor  Light
#> 98           6.2         2.9          4.3         1.3 versicolor  Light
#> 54           5.5         2.3          4.0         1.3 versicolor  Light
#> 84           6.0         2.7          5.1         1.6 versicolor  Light
#> 74           6.1         2.8          4.7         1.2 versicolor  Light
#> 52           6.4         3.2          4.5         1.5 versicolor  Light
#> 92           6.1         3.0          4.6         1.4 versicolor  Light
#> 88           6.3         2.3          4.4         1.3 versicolor  Light
#> 96           5.7         3.0          4.2         1.2 versicolor  Light
#> 86           6.0         3.4          4.5         1.6 versicolor  Light
#> 90           5.5         2.5          4.0         1.3 versicolor  Light
#> 78           6.7         3.0          5.0         1.7 versicolor  Light
#> 68           5.8         2.7          4.1         1.0 versicolor  Light
#> 76           6.6         3.0          4.4         1.4 versicolor  Light
#> 150          5.9         3.0          5.1         1.8  virginica  Light
#> 102          5.8         2.7          5.1         1.9  virginica  Light
#> 140          6.9         3.1          5.4         2.1  virginica  Light
#> 144          6.8         3.2          5.9         2.3  virginica  Light
#> 148          6.5         3.0          5.2         2.0  virginica  Light
#> 136          7.7         3.0          6.1         2.3  virginica  Light
#> 116          6.4         3.2          5.3         2.3  virginica  Light
#> 112          6.4         2.7          5.3         1.9  virginica  Light
#> 134          6.3         2.8          5.1         1.5  virginica  Light
#> 118          7.7         3.8          6.7         2.2  virginica  Light
#> 128          6.1         3.0          4.9         1.8  virginica  Light
#> 110          7.2         3.6          6.1         2.5  virginica  Light
#> 114          5.7         2.5          5.0         2.0  virginica  Light
#> 122          5.6         2.8          4.9         2.0  virginica  Light
#> 138          6.4         3.1          5.5         1.8  virginica  Light
#> 104          6.3         2.9          5.6         1.8  virginica  Light
#> 120          6.0         2.2          5.0         1.5  virginica  Light
#> 5            5.0         3.6          1.4         0.2     setosa Strong
#> 49           5.3         3.7          1.5         0.2     setosa Strong
#> 13           4.8         3.0          1.4         0.1     setosa Strong
#> 23           4.6         3.6          1.0         0.2     setosa Strong
#> 45           5.1         3.8          1.9         0.4     setosa Strong
#> 27           5.0         3.4          1.6         0.4     setosa Strong
#> 11           5.4         3.7          1.5         0.2     setosa Strong
#> 29           5.2         3.4          1.4         0.2     setosa Strong
#> 35           4.9         3.1          1.5         0.2     setosa Strong
#> 3            4.7         3.2          1.3         0.2     setosa Strong
#> 47           5.1         3.8          1.6         0.2     setosa Strong
#> 25           4.8         3.4          1.9         0.2     setosa Strong
#> 37           5.5         3.5          1.3         0.2     setosa Strong
#> 7            4.6         3.4          1.4         0.3     setosa Strong
#> 39           4.4         3.0          1.3         0.2     setosa Strong
#> 43           4.4         3.2          1.3         0.2     setosa Strong
#> 41           5.0         3.5          1.3         0.3     setosa Strong
#> 57           6.3         3.3          4.7         1.6 versicolor Strong
#> 91           5.5         2.6          4.4         1.2 versicolor Strong
#> 51           7.0         3.2          4.7         1.4 versicolor Strong
#> 83           5.8         2.7          3.9         1.2 versicolor Strong
#> 75           6.4         2.9          4.3         1.3 versicolor Strong
#> 59           6.6         2.9          4.6         1.3 versicolor Strong
#> 55           6.5         2.8          4.6         1.5 versicolor Strong
#> 71           5.9         3.2          4.8         1.8 versicolor Strong
#> 89           5.6         3.0          4.1         1.3 versicolor Strong
#> 95           5.6         2.7          4.2         1.3 versicolor Strong
#> 73           6.3         2.5          4.9         1.5 versicolor Strong
#> 93           5.8         2.6          4.0         1.2 versicolor Strong
#> 79           6.0         2.9          4.5         1.5 versicolor Strong
#> 63           6.0         2.2          4.0         1.0 versicolor Strong
#> 77           6.8         2.8          4.8         1.4 versicolor Strong
#> 85           5.4         3.0          4.5         1.5 versicolor Strong
#> 53           6.9         3.1          4.9         1.5 versicolor Strong
#> 115          5.8         2.8          5.1         2.4  virginica Strong
#> 103          7.1         3.0          5.9         2.1  virginica Strong
#> 149          6.2         3.4          5.4         2.3  virginica Strong
#> 131          7.4         2.8          6.1         1.9  virginica Strong
#> 117          6.5         3.0          5.5         1.8  virginica Strong
#> 123          7.7         2.8          6.7         2.0  virginica Strong
#> 125          6.7         3.3          5.7         2.1  virginica Strong
#> 111          6.5         3.2          5.1         2.0  virginica Strong
#> 119          7.7         2.6          6.9         2.3  virginica Strong
#> 121          6.9         3.2          5.7         2.3  virginica Strong
#> 147          6.3         2.5          5.0         1.9  virginica Strong
#> 101          6.3         3.3          6.0         2.5  virginica Strong
#> 135          6.1         2.6          5.6         1.4  virginica Strong
#> 105          6.5         3.0          5.8         2.2  virginica Strong
#> 113          6.8         3.0          5.5         2.1  virginica Strong
#> 141          6.7         3.1          5.6         2.4  virginica Strong
#> 143          5.8         2.7          5.1         1.9  virginica Strong
#> 
#> $test
#>     Sepal.Length Sepal.Width Petal.Length Petal.Width    Species  Smell
#> 2            4.9         3.0          1.4         0.2     setosa  Light
#> 14           4.3         3.0          1.1         0.1     setosa  Light
#> 22           5.1         3.7          1.5         0.4     setosa  Light
#> 28           5.2         3.5          1.5         0.2     setosa  Light
#> 32           5.4         3.4          1.5         0.4     setosa  Light
#> 36           5.0         3.2          1.2         0.2     setosa  Light
#> 46           4.8         3.0          1.4         0.3     setosa  Light
#> 50           5.0         3.3          1.4         0.2     setosa  Light
#> 58           4.9         2.4          3.3         1.0 versicolor  Light
#> 62           5.9         3.0          4.2         1.5 versicolor  Light
#> 64           6.1         2.9          4.7         1.4 versicolor  Light
#> 70           5.6         2.5          3.9         1.1 versicolor  Light
#> 72           6.1         2.8          4.0         1.3 versicolor  Light
#> 80           5.7         2.6          3.5         1.0 versicolor  Light
#> 82           5.5         2.4          3.7         1.0 versicolor  Light
#> 100          5.7         2.8          4.1         1.3 versicolor  Light
#> 106          7.6         3.0          6.6         2.1  virginica  Light
#> 108          7.3         2.9          6.3         1.8  virginica  Light
#> 124          6.3         2.7          4.9         1.8  virginica  Light
#> 126          7.2         3.2          6.0         1.8  virginica  Light
#> 130          7.2         3.0          5.8         1.6  virginica  Light
#> 132          7.9         3.8          6.4         2.0  virginica  Light
#> 142          6.9         3.1          5.1         2.3  virginica  Light
#> 146          6.7         3.0          5.2         2.3  virginica  Light
#> 1            5.1         3.5          1.4         0.2     setosa Strong
#> 9            4.4         2.9          1.4         0.2     setosa Strong
#> 15           5.8         4.0          1.2         0.2     setosa Strong
#> 17           5.4         3.9          1.3         0.4     setosa Strong
#> 19           5.7         3.8          1.7         0.3     setosa Strong
#> 21           5.4         3.4          1.7         0.2     setosa Strong
#> 31           4.8         3.1          1.6         0.2     setosa Strong
#> 33           5.2         4.1          1.5         0.1     setosa Strong
#> 61           5.0         2.0          3.5         1.0 versicolor Strong
#> 65           5.6         2.9          3.6         1.3 versicolor Strong
#> 67           5.6         3.0          4.5         1.5 versicolor Strong
#> 69           6.2         2.2          4.5         1.5 versicolor Strong
#> 81           5.5         2.4          3.8         1.1 versicolor Strong
#> 87           6.7         3.1          4.7         1.5 versicolor Strong
#> 97           5.7         2.9          4.2         1.3 versicolor Strong
#> 99           5.1         2.5          3.0         1.1 versicolor Strong
#> 107          4.9         2.5          4.5         1.7  virginica Strong
#> 109          6.7         2.5          5.8         1.8  virginica Strong
#> 127          6.2         2.8          4.8         1.8  virginica Strong
#> 129          6.4         2.8          5.6         2.1  virginica Strong
#> 133          6.4         2.8          5.6         2.2  virginica Strong
#> 137          6.3         3.4          5.6         2.4  virginica Strong
#> 139          6.0         3.0          4.8         1.8  virginica Strong
#> 145          6.7         3.3          5.7         2.5  virginica Strong
#>