handle_noise: Handling noise in the clustering results

View source: R/handle_noise.R

handle_noiseR Documentation

Handling noise in the clustering results

Description

This function finds noise from the clustering results and label it with -1.

Usage

handle_noise(global_membership, timeID, minPts, minTime)

Arguments

global_membership

Integer. A vector of membership labels.

timeID

Integer. A vector of time indexes.

minPts

Numeric (>0). Minimum number of hot spots in a cluster.

minTime

Numeric (>=0). Minimum length of time of a cluster. Unit is time index.

Details

For more details about the clustering algorithm and the arguments minPts and minTime, please check the documentation of hotspot_cluster(). This function performs the step 4 of the clustering algorithm. It uses a given threshold (minimum number of points and minimum length of time) to find noise and label it with -1.

Value

Integer. A vector of membership labels.

Examples


# Define membership labels and timeID for 10 observations
global_membership <- c(1,1,1,2,2,2,2,2,2,3,3,3,3,3,3)
timeID <- c(1,2,3,2,3,3,4,5,6,3,3,3,3,3,3)

# Handle noise with different values of minPts and minTime
handle_noise(global_membership, timeID, 4, 0)
handle_noise(global_membership, timeID, 4, 1)
handle_noise(global_membership, timeID, 3, 3)


TengMCing/spotoroo documentation built on Nov. 21, 2024, 4:17 a.m.