View source: R/entropy_weight.R
entropy_weight | R Documentation |
Computes the weights of indicators and scores of samples based on the entropy method. This method objectively determines the importance of each indicator according to the amount of information it contains.
entropy_weight(X, index = NULL)
X |
A numeric data frame or matrix where rows represent samples (observations) and columns represent indicators (variables). |
index |
A character vector indicating the direction of each indicator.
Use |
A list containing:
w |
Numeric vector of weights for each indicator. |
s |
Numeric vector of scores for each sample (row), scaled by 100. |
# Example: Using entropy weight method on a simple dataset
X = data.frame(
x1 = c(3, 5, 2, 7),
x2 = c(10, 20, 15, 25)
)
index = c("+", "-")
entropy_weight(X, index)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.