Description Usage Arguments Value See Also Examples
Returns gini coeffient of one or more models
Note: Predictions should be annualised (independent of exposure)
1 | metric_gini(actual, predicted, weight = NULL, na.rm = FALSE)
|
actual |
Array[Numeric] - Values we are aiming to predict. |
predicted |
Array[Numeric] / DataFrame[Numeric] - Values that we have predicted. |
weight |
Optional: Array[Numeric] - Weighting of predictions. If NULL even weighting is used. |
na.rm |
logical. Should missing values be removed? |
gini coeffient. Single value if predicted
is vector. Named list if predicted
is dataframe.
1 2 3 4 5 6 7 8 9 10 11 | # Input as vector
actual <- rnorm(100, mean=100, sd=10)
weight <- rep(1,100)
predicted <- actual + rnorm(100, mean=0, sd=1)
metric_gini(actual, predicted, weight)
# Input as dataframe
predicted <- data.frame(pred1 = actual + rnorm(100, mean=0, sd=1), pred2 = rnorm(100, mean=0, sd=1))
metric_gini(actual, predicted, weight)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.