This function selects subset of rows from data set. This is usefull if data is large and we need just a sample to calculate profiles.

select_sample(data, n = 100, seed = 1313)

Arguments

data

set of observations. Profile will be calculated for every observation (every row)

n

named list of vectors. Elements of the list are vectors with points in which profiles should be calculated. See an example for more details.

seed

seed for random number generator.

Value

a data frame with selected rows

Details

Note that select_subsample function is S3 generic. If you want to work on non standard data sources (like H2O ddf, external databases) you should overload it.

Examples

library("DALEX") small_apartments <- select_sample(apartmentsTest) head(small_apartments)
#> m2.price construction.year surface floor no.rooms district #> 8946 2174 1959 123 8 4 Wola #> 4458 4319 1927 68 8 2 Ochota #> 7384 5501 1929 95 5 3 Srodmiescie #> 5450 2810 1982 124 10 5 Ochota #> 6744 1770 1982 143 9 6 Ursynow #> 6688 2796 1938 75 7 3 Wola