# # Author: Gabriel Teotonio
# # Title: Ad-hoc tests
# # Date: 2022-03-12
#
#
# # Create objects -----
# variation_weight <- "local-adaptive-sum"
# type <- "nominal"
#
# X <- matrix(c("green","blue","blue","black","blue",
# "object","place","place","place", "name",
# "recife","recife","olinda","recife","paulista"),
# ncol = 3)
# X <- unname(matrix(as.character(X), ncol = ncol(X)))
# c <- 2
# n <- nrow(X)
# p <- ncol(X)
# V <- matrix(0L, nrow = c, ncol = p)
# if (variation_weight == "local-adaptive-sum" ||
# variation_weight == "local-adaptive-product") {
# if (variation_weight == "local-adaptive-sum") {
# L <- matrix(1 / p, nrow = c, ncol = p)
# } else {
# L <- matrix(1L, nrow = c, ncol = p)
# }
# } else if (variation_weight == "global-adaptive-sum") {
# L <- matrix(1 / p, ncol = p)
# } else {
# L <- matrix(1L, ncol = p)
# }
# U <- matrix(1 / c, nrow = n, ncol = c)
# J <- 10 ^ (10)
# J_aux <- 1L
#
#
# # Tests ----
# ## Testing update_centroid() -----
# # Reference update_centroid(U[, i], X[, j])
# V[1, 1] <- update_centroid(u = U[, 1], x = X[, 1])
# V[1, 2] <- update_centroid(u = U[, 1], x = X[, 2])
# V[1, 3] <- update_centroid(u = U[, 1], x = X[, 3])
#
# V[2, 1] <- update_centroid(u = U[, 2], x = X[, 1])
# V[2, 2] <- update_centroid(u = U[, 2], x = X[, 2])
# V[2, 3] <- update_centroid(u = U[, 2], x = X[, 3])
#
# ## Testing update_weight() -----
# # Reference L[i, j] <- update_weight(variation_weight, type, U[, i], X, V[i,], beta, m, p, j)
# variation_weight <- "local-adaptive-sum"
# variation_weight <- "local-adaptive-product"
# L[1, 1] <- update_weight(variation_weight, type, U[, 1], X, V[1, ], beta = 2, m = 2, p, j = 1, c = c)
# L[1, 2] <- update_weight(variation_weight, type, U[, 1], X, V[1, ], beta = 2, m = 2, p, j = 2, c = c)
# L[1, 3] <- update_weight(variation_weight, type, U[, 1], X, V[1, ], beta = 2, m = 2, p, j = 3, c = c)
# L[2, 1] <- update_weight(variation_weight, type, U[, 2], X, V[2, ], beta = 2, m = 2, p, j = 1, c = c)
# L[2, 2] <- update_weight(variation_weight, type, U[, 2], X, V[2, ], beta = 2, m = 2, p, j = 2, c = c)
# L[2, 3] <- update_weight(variation_weight, type, U[, 2], X, V[2, ], beta = 2, m = 3, p, j = 1, c = c)
#
# variation_weight <- "global-adaptive-sum"
# variation_weight <- "global-adaptive-product"
# update_weight(variation_weight, type, U, X, V, beta = 2, m = 2, p, j = 1, c = c)
#
# ## Testing update_membership() -----
# # Reference U[k, i] <- update_membership(variation_weight, type, X[k, ], V, m, L, beta, i, c)
# U[1, 1] <- update_membership(variation_weight, type, X[1, ], V, m = 2, L, beta = 2, i = 1, c = c)
# U[1, 2] <- update_membership(variation_weight, type, X[1, ], V, m = 2, L, beta = 2, i = 2, c = c)
# U[2, 1] <- update_membership(variation_weight, type, X[2, ], V, m = 2, L, beta = 2, i = 1, c = c)
# U[2, 2] <- update_membership(variation_weight, type, X[2, ], V, m = 2, L, beta = 2, i = 2, c = c)
# U[3, 1] <- update_membership(variation_weight, type, X[3, ], V, m = 2, L, beta = 2, i = 1, c = c)
# U[3, 2] <- update_membership(variation_weight, type, X[3, ], V, m = 2, L, beta = 2, i = 2, c = c)
# U[4, 1] <- update_membership(variation_weight, type, X[4, ], V, m = 2, L, beta = 2, i = 1, c = c)
# U[4, 2] <- update_membership(variation_weight, type, X[4, ], V, m = 2, L, beta = 2, i = 2, c = c)
# U[5, 1] <- update_membership(variation_weight, type, X[5, ], V, m = 2, L, beta = 2, i = 1, c = c)
# U[5, 2] <- update_membership(variation_weight, type, X[5, ], V, m = 2, L, beta = 2, i = 2, c = c)
#
# ## Testing update_objective() -----
# # Reference J <- update_objective(variation_weight, type, U, X, V, L, beta, m, c, n)
# update_objective(variation_weight, type, U, X, V, L, beta = 2, m = 2, c = c, n = n)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.