Print Dataset Level Model Performance Summary

# S3 method for model_performance
print(x, ...)

Arguments

x

a model to be explained, object of the class 'model_performance_explainer'

...

other parameters

Examples

# \donttest{ library("ranger") titanic_ranger_model <- ranger(survived~., data = titanic_imputed, num.trees = 100, probability = TRUE) # It's a good practice to pass data without target variable explainer_ranger <- explain(titanic_ranger_model, data = titanic_imputed[,-8], y = titanic_imputed$survived)
#> Preparation of a new explainer is initiated #> -> model label : ranger ( default ) #> -> data : 2207 rows 7 cols #> -> target variable : 2207 values #> -> predict function : yhat.ranger will be used ( default ) #> -> predicted values : No value for predict function target column. ( default ) #> -> model_info : package ranger , ver. 0.13.1 , task classification ( default ) #> -> predicted values : numerical, min = 0.01355464 , mean = 0.3221177 , max = 0.9944679 #> -> residual function : difference between y and yhat ( default ) #> -> residuals : numerical, min = -0.8117189 , mean = 3.904153e-05 , max = 0.8840863 #> A new explainer has been created!
# resulting dataframe has predicted values and residuals mp_ex_rn <- model_performance(explainer_ranger) mp_ex_rn
#> Measures for: classification #> recall : 0.5935302 #> precision : 0.9036403 #> f1 : 0.7164686 #> accuracy : 0.8486633 #> auc : 0.9006173 #> #> Residuals: #> 0% 10% 20% 30% 40% 50% #> -0.81171892 -0.25226303 -0.20774924 -0.18118058 -0.15976418 -0.12705539 #> 60% 70% 80% 90% 100% #> -0.09117005 0.02924529 0.21810965 0.61018264 0.88408631
plot(mp_ex_rn)
# }