getOptimalPartitionDf: Get optimal partition (clusters dictionary)

Description Usage Arguments Details Value

Description

Splits factor levels into non-overlapping clusters based on a factorMerger object. If a stat is "loglikelihood" or "p-value" then performs bottom-up search through models on the merging path until spots a model scored worse than the given threshold (value). If stat = "GIC", value is interpreted as GIC penalty and optimal GIC model is returned.

Usage

1
getOptimalPartitionDf(factorMerger, stat = "GIC", value = 2)

Arguments

factorMerger

object of a class factorMerger

stat

statistic used in the bottom-up search. Available statistics are: "loglikelihood", "p-value", "GIC".

value

cut threshold / GIC penalty

Details

By default, cutree returns factor partition corresponding to the optimal GIC model (with the lowest GIC).

Value

Returns a dictionary in a data frame format. Each row gives an original label of a factor level and its new (cluster) label.


factorMerger documentation built on July 4, 2019, 1:02 a.m.