class_graph: Construct a Class Graph

View source: R/class_graph.R

class_graphR Documentation

Construct a Class Graph

Description

A graph in which members of the same class have edges.

Usage

class_graph(labels, sparse = TRUE)

Arguments

labels

A vector of class labels.

sparse

A logical value, indicating whether to use sparse matrices in the computation. Default is TRUE.

Value

A class_graph object, which is a list containing the following components:

  • adjacencyA matrix representing the adjacency of the graph.

  • paramsA list of parameters used in the construction of the graph.

  • labelsA vector of class labels.

  • class_indicesA list of vectors, each containing the indices of elements belonging to a specific class.

  • class_freqA table of frequencies for each class.

  • levelsA vector of unique class labels.

  • classesA character string indicating the type of graph ("class_graph").

Examples

data(iris)
labels <- iris[,5]
cg <- class_graph(labels)


bbuchsbaum/neighborweights documentation built on April 1, 2024, 8:41 p.m.