table_integrated_gradients_results | R Documentation |
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))
table_integrated_gradients_results(analysis_object, show_table = FALSE)
analysis_object |
Fitted analysis_object with 'sensitivity_analysis(methods = "Integrated Gradients")'. |
show_table |
Boolean. Whether to show the table. |
Tibble or list of tibbles (multiclass classification) with Integrated Gradient summarized results.
# 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)) {
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.