Radar plot with model score. score are scaled to [0,1], each score is inversed and divided by maximum score value.

plot_radar(object, ..., score = c("mae", "mse", "rec", "rroc"),
  new_score = NULL, print = TRUE)

plotModelRanking(object, ..., score = c("MAE", "MSE", "REC", "RROC"),
  new_score = NULL)

Arguments

object

An object of class 'auditor_model_performance' created with model_performance function.

...

Other auditor_model_performance' objects to be plotted together.

score

Vector of score names to be plotted.

new_score

A named list of functions that take one argument: object of class ModelAudit and return a numeric value. The measure calculated by the function should have the property that lower score value indicates better model.

print

Logical, indicates whether values of scores should be printed.

Value

ggplot object

Examples

dragons <- DALEX::dragons[1:100, ] # fit a model model_lm <- lm(life_length ~ ., data = dragons) # use DALEX package to wrap up a model into explainer exp_lm <- DALEX::explain(model_lm, data = dragons, y = dragons$life_length)
#> Preparation of a new explainer is initiated #> -> model label : lm (default) #> -> data : 100 rows 8 cols #> -> target variable : 100 values #> -> predict function : yhat.lm will be used (default) #> -> predicted values : numerical, min = 585.8311 , mean = 1347.787 , max = 2942.307 #> -> residual function : difference between y and yhat (default) #> -> residuals : numerical, min = -88.41755 , mean = -1.489291e-13 , max = 77.92805 #> A new explainer has been created!
# validate a model with auditor library(auditor) mp_lm <- model_performance(exp_lm) library(randomForest) model_rf <- randomForest(life_length~., data = dragons) exp_rf <- DALEX::explain(model_rf, data = dragons, y = dragons$life_length)
#> Preparation of a new explainer is initiated #> -> model label : randomForest (default) #> -> data : 100 rows 8 cols #> -> target variable : 100 values #> -> predict function : yhat.randomForest will be used (default) #> -> predicted values : numerical, min = 767.6671 , mean = 1344.276 , max = 2494.033 #> -> residual function : difference between y and yhat (default) #> -> residuals : numerical, min = -187.9356 , mean = 3.511072 , max = 404.3873 #> A new explainer has been created!
mp_rf <- model_performance(exp_rf) # plot results plot_radar(mp_lm, mp_rf)
#> Error in check_object(object, type = "prfm"): The function requires an object created with function model_performance().