Learn R Programming

MLwrap (version 0.1.0)

table_integrated_gradients_results: Integrated Gradients Summarized Results Table

Description

The table_integrated_gradients_results() function implements the same summarized metrics scheme for Integrated Gradients values, a methodology specifically designed for neural networks that calculates feature importance through gradient integration along paths from a baseline to the current input. To summarize the Integrated Gradients values calculated, three different metrics are computed:

  • Mean Absolute Value

  • Standard Deviation of Mean Absolute Value

  • Directional Sensitivity Value (Cov(Feature values, IG values) / Var(Feature values))

Usage

table_integrated_gradients_results(analysis_object, show_table = FALSE)

Value

Tibble or list of tibbles (multiclass classification) with Integrated Gradient summarized results.

Arguments

analysis_object

Fitted analysis_object with 'sensitivity_analysis(methods = "Integrated Gradients")'.

show_table

Boolean. Whether to show the table.

Examples

Run this code
# Note: For obtaining the table with Integrated Gradients method results
# the user needs to complete till sensitivity_analysis() function of the
# MLwrap pipeline using the Integrated Gradient method.

if (requireNamespace("torch", quietly = TRUE)) {

  # \donttest{

  wrap_object <- preprocessing(df = sim_data,
                             formula = psych_well ~ depression + emot_intel + resilience,
                             task = "regression")
  wrap_object <- build_model(wrap_object, "Neural Network")
  wrap_object <- fine_tuning(wrap_object, "Bayesian Optimization")
  wrap_object <- sensitivity_analysis(wrap_object, methods = "Integrated Gradients")

  # And then, you can obtain the Integrated Gradients results table.

  table_IG <- table_integrated_gradients_results(wrap_object)

  # }

}

Run the code above in your browser using DataLab