normalizeWeight {LearnClust} | R Documentation |
To normalize weight values.
Description
To normalize weight values if normalize
= TRUE.
Usage
normalizeWeight(normalize, weight, data)
Arguments
normalize |
is a boolean value. |
weight |
is a numeric vector. |
data |
is a data.frame. |
Details
This function allows users to normalize weights.
If there is not any weight, the function will create a numeric vector of "1".
If normalize = TRUE, the function will make every weight value as a "[0:1]" value.
If normalize = FALSE, the function will not make any changes, weights will be the same.
Value
Numeric vector with updated weights.
Author(s)
Roberto Alcántara roberto.alcantara@edu.uah.es
Juan José Cuadrado jjcg@uah.es
Universidad de Alcalá de Henares
Examples
data <- data.frame(matrix(c(1:10),ncol = 2))
weight1 <- c(0.6,0.4)
weight2 <- c(2,4)
normalizeWeight(FALSE, weight1, data)
normalizeWeight(TRUE, weight2, data)
normalizeWeight(FALSE, weight2, data)
[Package LearnClust version 1.1 Index]