View source: R/cal-plot-regression.R

cal_plot_regression | R Documentation |

A scatter plot of the observed and predicted values is computed where the
axes are the same. When `smooth = TRUE`

, a generalized additive model fit
is shown. If the predictions are well calibrated, the fitted curve should align with
the diagonal line.

```
cal_plot_regression(.data, truth = NULL, estimate = NULL, smooth = TRUE, ...)
## S3 method for class 'data.frame'
cal_plot_regression(
.data,
truth = NULL,
estimate = NULL,
smooth = TRUE,
...,
.by = NULL
)
## S3 method for class 'tune_results'
cal_plot_regression(.data, truth = NULL, estimate = NULL, smooth = TRUE, ...)
## S3 method for class 'grouped_df'
cal_plot_regression(.data, truth = NULL, estimate = NULL, smooth = TRUE, ...)
```

`.data` |
An ungrouped data frame object containing a prediction column. |

`truth` |
The column identifier for the true results (numeric). This should be an unquoted column name. |

`estimate` |
The column identifier for the predictions. This should be an unquoted column name |

`smooth` |
A logical: should a smoother curve be added. |

`...` |
Additional arguments passed to |

`.by` |
The column identifier for the grouping variable. This should be
a single unquoted column name that selects a qualitative variable for
grouping. Default to |

A ggplot object.

```
cal_plot_regression(boosting_predictions_oob, outcome, .pred)
cal_plot_regression(boosting_predictions_oob, outcome, .pred,
alpha = 1 / 6, cex = 3, smooth = FALSE
)
cal_plot_regression(boosting_predictions_oob, outcome, .pred,
.by = id,
alpha = 1 / 6, cex = 3, smooth = FALSE
)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.