handle_noise {spotoroo}R 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)


[Package spotoroo version 0.1.4 Index]