50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


DCEM (version 1.0.0)

max_heapify: max_heapify: Part of DCEM package.

Description

Implements the max-heapify process to create the heap. This function is for internal use and is called by the dcem_star_cluster_uv (univariate data) and dcem_star_cluster_mv (multivariate data).

Usage

max_heapify(data, index, N)

Arguments

data

(dataframe): The dataframe containing the key, value pairs.

index

(numeric): Index of the node.

N

(numeric): Size of the heap.

Value

data frame: The data frame containing the heap.

References

Using data to build a better EM: EM* for big data.

Hasan Kurban, Mark Jenne, Mehmet M. Dalkilic (2016) <doi:https://doi.org/10.1007/s41060-017-0062-1>.

Examples

Run this code
# NOT RUN {
# Create a sample data frame
heap <- data.frame(keys=c(0,3,4,5), vals=c(7,7,4,6))

# Build the heap from the data frame.
heap <- build_heap(heap)

# Call max-heapify untill the last node

i = floor(nrow(heap)/2)
while (i>=1){
 heap = max_heapify(heap, i, nrow(heap))
 i = i-1
}

# }

Run the code above in your browser using DataLab