Learn R Programming

muHVT (version 2.0.0)

diagPlot: 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",
  ...
)

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)

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

Author

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

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)

See Also

predictHVT

Examples

Run this code
data(USArrests)
hvt.results <- list()
hvt.results <- HVT(USArrests, nclust = 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)

Run the code above in your browser using DataLab