Skip to content
/ clap Public

clap: Detecting Class Overlapping Regions in Multidimensional Data πŸ‘πŸ‘πŸ‘

Notifications You must be signed in to change notification settings

pridiltal/clap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

clap

CRAN_Status_Badge Lifecycle: maturing

clap: Detecting Class Overlapping Regions in Multidimensional Data

The issue of overlapping regions in multidimensional data arises when different classes or clusters share similar feature representations, making it challenging to delineate distinct boundaries between them accurately. This package provides methods for detecting and visualizing these overlapping regions using partitional clustering techniques based on nearest neighbor distances.

Installation

You can install the development version of clap from GitHub with:

# install.packages("devtools")
devtools::install_github("pridiltal/clap")

Installation

You can install the development version of clap from GitHub with:

# install.packages("devtools")
devtools::install_github("pridiltal/clap")

Example

library(clap)
class1 <- matrix(rnorm(100, mean = 0, sd = 1), ncol = 2) + matrix(rep(c(1, 1), each = 50), ncol = 2)
class2 <- matrix(rnorm(100, mean = 0, sd = 1), ncol = 2) + matrix(rep(c(-1, -1), each = 50), ncol = 2)
datanew <- rbind(class1, class2)
training <- data.frame(datanew,
class = factor(c(rep(1, 50), rep(2, 50))))

# Plot the dummy data to visualize overlaps
p <- ggplot2::ggplot(training, ggplot2::aes(x = X1, y = X2, color = class)) +
ggplot2::geom_point() +
ggplot2::labs(title = "Dummy Data with Overlapping Classes")
print(p)

# Perform clustering
cluster_result <- perform_clustering(training, class_column = class)
# Compute cluster composition
composition <- compute_cluster_composition(cluster_result)
# Extract IDs to numeric vector
ids_vector <- extract_ids_vector(composition)
# Subset data based on extracted IDs
overlapdata <- training[ids_vector, ]
# Plot overlapping data points
p2 <- p + ggplot2::geom_point(data = overlapdata, ggplot2::aes(X1, X2), colour = "black")
(p2)

About

clap: Detecting Class Overlapping Regions in Multidimensional Data πŸ‘πŸ‘πŸ‘

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages