diagPlot: Diagnosis Plot

View source: R/diagPlot.R

diagPlotR Documentation

Diagnosis Plot

Description

Function to construct Diagnosis Plots for HVT Model

Usage

diagPlot(
  hvt.results,
  data,
  level,
  quant.err,
  distance_metric = "L1_Norm",
  error_metric = "max",
  ...
)

Arguments

data

Data frame. A data frame with different columns is given as input. The dataframe should be the same dataframe used to train the HVT Model

level

Numeric. Indicating the level for which the heat map is to be plotted.

quant.err

Numeric. A number indicating the quantization error threshold.

...

The ellipsis is passed to it as additional argument. (Used internally)

hvt.results.model

A list of hvt.results.model obtained from HVT function while performing hierarchical vector quantization on train data

Details

This function creates Diagnosis Plots for HVT Model. The output of the functions contains a Minimum Intra-Centroid distance plot, a Minimum Intra-DataPoint Distance Plot, Distribution of number of cells, a Minimum Intra-DataPoint Distance Plot, Distribution of number of cells and count of singletons(segments with single observation)

Value

A list that contains a Minimum Inter-Centroid distance plot, a Minimum Intra-DataPoint Distance Plot, Distribution of number of cells and count of singletons(segments with single observation)

cent_plot

Plot. a Minimum Intra-Centroid distance plot

datapoint_plot

Plot. a Minimum Intra-Datapoints distance plot

number_plot

Plot. a Distribution of number of cells

singleton_count

Numeric. Count of singletons(segments with single observation)

Author(s)

Shubhra Prakash <shubhra.prakash@mu-sigma.com>

See Also

predictHVT

Examples

data(USArrests)
hvt.results <- list()
hvt.results <- HVT(USArrests, n_cells = 15, depth = 1, quant.err = 0.2, 
                   distance_metric = "L1_Norm", error_metric = "mean",
                   projection.scale = 10, normalize = TRUE,
                   quant_method="kmeans",diagnose=TRUE)
diagPlot(hvt.results = hvt.results,
data = USArrests,
level = 1,
quant.err = 0.2)


muHVT documentation built on March 7, 2023, 6:38 p.m.