Learn R Programming

MLwrap (version 0.1.0)

plot_scatter_residuals: Plotting Residuals vs Predictions

Description

The plot_scatter_residuals() function produces scatter plots relating residuals to predictions, facilitating identification of heteroscedasticity and non-linear patterns in model errors. This diagnostic plot is essential for validating regression model assumptions and detecting potential issues with model specification or data quality.

Usage

plot_scatter_residuals(analysis_object)

Value

analysis_object

Arguments

analysis_object

Fitted analysis_object with 'fine_tuning()'.

Examples

Run this code
# Note: For obtaining the residuals vs. predicted values plot the user needs to
# complete till fine_tuning( ) function of the MLwrap pipeline.

# \donttest{

wrap_object <- preprocessing(df = sim_data,
                             formula = psych_well ~ depression + emot_intel + resilience,
                             task = "regression")
wrap_object <- build_model(wrap_object, "Random Forest")
wrap_object <- fine_tuning(wrap_object, "Bayesian Optimization")

# And then, you can obtain the residuals vs predicted values plot.

plot_scatter_residuals(wrap_object)

# }

Run the code above in your browser using DataLab