LIFT is a plot of the rate of positive prediction against true positive rate for the different thresholds. It is useful for measuring and comparing the accuracy of the classificators.

plot_lift(object, ...)

plotLIFT(object, ...)

## Arguments

object An object of class 'auditor_model_evaluation' created with model_evaluation function. Other 'auditor_model_evaluation' objects to be plotted together.

## Value

A ggplot object.

model_evaluation

## Examples

titanic <- na.omit(DALEX::titanic)
titanic$survived <- titanic$survived == "yes"

# fit a model
model_glm <- glm(survived ~ ., family = binomial, data = titanic)

# use DALEX package to wrap up a model into explainer
exp_glm <- DALEX::explain(model_glm, data = titanic, y = titanic$survived)#> Preparation of a new explainer is initiated #> -> model label : lm ( default ) #> -> data : 2099 rows 9 cols #> -> target variable : 2099 values #> -> data : A column identical to the target variable y has been found in the data. ( WARNING ) #> -> data : It is highly recommended to pass data without the target variable column #> -> predict function : yhat.glm will be used ( default ) #> -> predicted values : numerical, min = 9.814966e-09 , mean = 0.3244402 , max = 1 #> -> residual function : difference between y and yhat ( default ) #> -> residuals : numerical, min = -0.9614217 , mean = -1.68201e-09 , max = 0.9666502 #> A new explainer has been created! # validate a model with auditor library(auditor) eva_glm <- model_evaluation(exp_glm) # plot results plot_lift(eva_glm) plot(eva_glm, type ="lift") model_glm_2 <- glm(survived ~ .-age, family = binomial, data = titanic) exp_glm_2 <- DALEX::explain(model_glm_2, data = titanic, y = titanic$survived, label = "glm2")#> Preparation of a new explainer is initiated
#>   -> model label       :  glm2
#>   -> data              :  2099  rows  9  cols
#>   -> target variable   :  2099  values
#>   -> data              :  A column identical to the target variable y has been found in the data.  (  WARNING  )
#>   -> data              :  It is highly recommended to pass data without the target variable column
#>   -> predict function  :  yhat.glm  will be used (  default  )
#>   -> predicted values  :  numerical, min =  1.431371e-08 , mean =  0.3244402 , max =  0.9999999
#>   -> residual function :  difference between y and yhat (  default  )
#>   -> residuals         :  numerical, min =  -0.9457109 , mean =  -1.684502e-09 , max =  0.9665453
#>   A new explainer has been created!  eva_glm_2 <- model_evaluation(exp_glm_2)

plot_lift(eva_glm, eva_glm_2) plot(eva_glm, eva_glm_2, type = "lift")
{"ft_lang_label":"__label__en","ft_lang_prob":0.58625937,"math_prob":0.88416755,"size":2463,"snap":"2019-51-2020-05","text_gpt3_token_len":726,"char_repetition_ratio":0.11834079,"word_repetition_ratio":0.5,"special_character_ratio":0.34794965,"punctuation_ratio":0.20476191,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99069214,"pos_list":[0,1,2,3,4,5,6,7,8],"im_url_duplicate_count":[null,2,null,2,null,2,null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-01-24T17:24:36Z\",\"WARC-Record-ID\":\"<urn:uuid:57428afb-3bc7-4b68-a337-5df158447c72>\",\"Content-Length\":\"14735\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:30dddebd-1076-4a43-a5b3-b5ee6a823c57>\",\"WARC-Concurrent-To\":\"<urn:uuid:845a1bed-3c21-49c7-8a5f-3bad376a33ed>\",\"WARC-IP-Address\":\"185.199.108.153\",\"WARC-Target-URI\":\"https://modeloriented.github.io/auditor/reference/plot_lift.html\",\"WARC-Payload-Digest\":\"sha1:KIBLHH27RIA7INVIGWKMU5LK2RLTYZCB\",\"WARC-Block-Digest\":\"sha1:DAVGQHE2RXHJZQWBMZUXORPXPYPTV44F\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-05/CC-MAIN-2020-05_segments_1579250624328.55_warc_CC-MAIN-20200124161014-20200124190014-00500.warc.gz\"}"}