eikmeans_test: Test a sample with an EI-kMeans partitioning

View source: R/dfr_eikmeans.R

eikmeans_testR Documentation

Test a sample with an EI-kMeans partitioning

Description

Assigns the points of a sample to the bins of an eikmeans() model and compares the counts with those of the training sample by Pearson's chi-square test.

Usage

eikmeans_test(model, sample)

Arguments

model

An eikmeans object.

sample

The sample to test (matrix or data frame with the training features).

Value

A data frame with the chi-square statistic, the degrees of freedom (df), the p_value and whether a drift is detected (drift, p_value < alpha).

Examples

set.seed(1)
model <- eikmeans(matrix(stats::rnorm(1000), ncol = 2), n_test = 100,
                  k = 10, min_points = 20)
eikmeans_test(model, matrix(stats::rnorm(200, 0.5), ncol = 2))

heimdall documentation built on Dec. 2, 2026, 5:08 p.m.