View source: R/Module_rankModels.R
rankModels | R Documentation |
rankModels(dat, columnToRank = NULL, relative.bol = FALSE)
dat |
An array. The retro function produces a list of arrays, any of those arrays can be used at the dat argument. Column names define each of the performance metrics, row names define the models. Performance metrics can include: "MRE", "MAE", "MPE", "MAPE", "MASE", "RMSE". |
columnToRank |
A character or integer vector. Values represent the index or names of columns to be ranked. If NA (the default) then all columns are ranked. |
relative.bol |
A Boolean. FALSE means use ordinal ranking (i.e. first, second, third,...). TRUE will use scaled ranking. Default is FALSE. Look to Details for additional information. |
A list of data frames. Each data frame represents the results of each age class (i.e. the third dimension of the input array). with ranking by performance metric and overall average.
## Not run: dat.rank <- apply(dat.arr, 3, function(x){ #input to ranking must be a data frame dat <- as.data.frame(x) #if argument columnToRank is left as NA (default) then all columns are used in ranking dat.rank <- getRanks(dat) return(dat.rank) }) str(dat.rank) #rank by column name rankModels(dat.arr[,,1], columnToRank = "MRE") #rank by column index rankModels(dat.arr[,,1], columnToRank = 1) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.