Partitioners are functions that tell the partition algorithm 1)
what to try to reduce 2) how to measure how much information is lost from
the reduction and 3) how to reduce the data. In partition, functions that
handle 1) are called directors, functions that handle 2) are called
metrics, and functions that handle 3) are called reducers. partition has a
number of pre-specified partitioners for agglomerative data reduction.
Custom partitioners can be created with as_partitioner()
.
Pass partitioner
objects to the partitioner
argument of partition()
.
part_pc1()
uses the following direct-measure-reduce approach:
direct: direct_distance()
, Minimum Distance
measure: measure_variance_explained()
, Variance Explained (PCA)
reduce: reduce_first_component()
, First Principal Component
part_pc1(spearman = FALSE)
a partitioner
Other partitioners:
as_partitioner()
,
part_icc()
,
part_kmeans()
,
part_minr2()
,
part_stdmi()
,
replace_partitioner()
set.seed(123)
df <- simulate_block_data(c(3, 4, 5), lower_corr = .4, upper_corr = .6, n = 100)
# fit partition using part_pc1()
partition(df, threshold = .6, partitioner = part_pc1())
#> Partitioner:
#> Director: Minimum Distance (Pearson)
#> Metric: Variance Explained (PCA)
#> Reducer: First Principal Component
#>
#> Reduced Variables:
#> 3 reduced variables created from 11 observed variables
#>
#> Mappings:
#> reduced_var_1 = {block3_x1, block3_x2, block3_x3, block3_x5}
#> reduced_var_2 = {block1_x1, block1_x2, block1_x3}
#> reduced_var_3 = {block2_x1, block2_x2, block2_x3, block2_x4}
#>
#> Minimum information:
#> 0.643