psych_kxi_ensemble_models {opticskxi}R Documentation

Example pipeline for ensemble models

Description

Example pipeline for ensemble models on mental health related natural language processing

Usage

psych_kxi_ensemble_models(
  m_data,
  ...,
  n_models = 4,
  metrics = NULL,
  metrics_exclude = NULL,
  model_subsample = c(0.1, 0.2, 0.5),
  n_models_subsample = 10
)

Arguments

m_data

Data matrix Data frame returned by optics

...

Passed to function psych_kxi_pipeline

n_models

Number of best models to return

metrics

Names of metrics to use. Any of those computed by opticskxi_pipeline, e.g. 'sindex', 'ch', 'dunn', 'dunn2', 'widestgap', 'entropy' etc. NULL for all (8).

metrics_exclude

Names of metrics to exclude. Typically used with metrics = NULL. E.g. 'entropy'.

model_subsample

Ratios of best models to consider.

n_models_subsample

Number of best models when subsampling.

Value

Input parameter data frame with with results binded in columns optics, clusters and metrics. Subsetted to best models according to ensemble metrics.

Examples

data('m_psychwords')
m_psychwords = m_psychwords[1:200, 1:20]

df_params = expand.grid(n_xi = 4:5, pts = c(5, 10), dist = 'cosine',
                        dim_red = 'ICA', n_dimred_comp = 5)

df_kxi = psych_kxi_ensemble_models(m_psychwords, df_params,
                                   n_min_clusters = 2,
                                   n_models = 4,
                                   metrics = c('avg.silwidth', 'dunn'),
                                   model_subsample = c(0.4, 0.6),
                                   n_models_subsample = 4)


[Package opticskxi version 1.1.0 Index]