### Installing probably R Package Development Version from GitHub Source: https://github.com/tidymodels/probably/blob/main/README.md This snippet shows how to install the development version of the 'probably' R package from its GitHub repository using the 'pak' package. The commented line indicates that 'pak' itself might need to be installed first. This method is useful for accessing the latest features or bug fixes before they are released on CRAN. ```R # install.packages("pak") pak::pak("tidymodels/probably") ``` -------------------------------- ### Installing probably R Package from CRAN Source: https://github.com/tidymodels/probably/blob/main/README.md This snippet demonstrates how to install the 'probably' R package directly from CRAN, the Comprehensive R Archive Network. This is the standard method for stable releases and requires an active internet connection to download and install the package and its dependencies. ```R install.packages("probably") ``` -------------------------------- ### Printing Grouped GAM Calibration Estimates for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-logistic.md This snippet prints the results of a Generalized Additive Model (GAM) calibration applied to a grouped data frame. It demonstrates the method's compatibility with grouped data, showing 1,010 data points split into 2 groups. It provides an overview of the calibration setup, including truth and estimate variables. ```R print(sl_gam_group) ``` -------------------------------- ### Printing Grouped Logistic Calibration Estimates for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-logistic.md This snippet prints the results of a logistic regression calibration applied to a grouped data frame. It indicates that the data points are split into 2 groups, demonstrating the calibration method's ability to handle grouped data. It provides an overview of the calibration setup, including truth and estimate variables. ```R print(sl_logistic_group) ``` -------------------------------- ### Displaying Bootstrapped Isotonic Binary Calibration for Data Frame (sl_boot) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-isotonic.md Displays the results of a bootstrapped isotonic regression calibration for binary classification on a data frame. It provides a summary of the calibration method, data source, and the mapping of predicted probability columns to original class labels. ```R print(sl_boot) ``` -------------------------------- ### Printing Multiclass Beta Calibration for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet displays the summary of a beta calibration model (`mtnl_beta`) for multiclass (1 vs All) classification, applied to `tune_results`. The summary shows the calibration method, type, source, data points split into 10 groups, and the truth (`class`) and estimate variables (`.pred_one`, `.pred_two`, `.pred_three`) for multiple classes. ```R print(mtnl_beta) ``` -------------------------------- ### Printing Beta Calibration for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet demonstrates printing the summary of a beta calibration model (`sl_beta`) applied to a data frame for binary classification. The output provides information on the calibration method, type (Binary), source class (Data Frame), data points, truth variable (`Class`), and the estimate variables (`.pred_good`, `.pred_poor`) for class predictions. ```R print(sl_beta) ``` -------------------------------- ### Printing Beta Calibration for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet prints the summary of a beta calibration model (`tl_beta`) when applied to `tune_results` for binary classification. The output details the calibration method, type (Binary), source class (Tune Results), data points split into 8 groups, and the truth (`class`) and estimate variables (`.pred_class_1`, `.pred_class_2`). ```R print(tl_beta) ``` -------------------------------- ### Printing GAM Calibration Estimates for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-logistic.md This snippet prints the results of a Generalized Additive Model (GAM) calibration when applied to `tune_results` objects. It confirms the method's functionality with tuning outputs, handling 4,000 data points split into 8 groups. It outlines the calibration method, type, and the variables involved. ```R print(tl_gam) ``` -------------------------------- ### Printing Bootstrapped Isotonic Regression Calibration for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet shows the output of printing a bootstrapped isotonic regression calibration model (`sl_boot`) for binary classification on a data frame. It details the method, type (Binary), source, data points, truth variable (`Class`), and the specific estimate variables (`.pred_good`, `.pred_poor`) for class predictions. ```R print(sl_boot) ``` -------------------------------- ### Printing Logistic Spline Calibration Estimates for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md Presents the output of GAM calibration when applied to `tune_results`, similar to the logistic regression case. It confirms the method and source class, showing how spline-based calibration integrates with tuning workflows. ```R print(tl_gam) ``` -------------------------------- ### Printing Isotonic Calibration Estimates for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md Presents the output of isotonic regression calibration when applied to `tune_results`. It includes 'Unique Predicted Values' and details about the source class and data points, showing its compatibility with tuning workflows. ```R print(tl_isotonic) ``` -------------------------------- ### Printing Binary Beta Calibration Estimates for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-beta.md This snippet shows how to print the results of a binary beta calibration when the source data is `tune_results`. It outlines the calibration method, type, source class, total data points, and the specific truth and estimate variables used for calibration within the tune results. ```R print(tl_beta) ``` -------------------------------- ### Displaying Isotonic Binary Calibration for Data Frame (sl_isotonic) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-isotonic.md Displays the results of an isotonic regression calibration for binary classification on a data frame. It provides a summary of the calibration method, data source, and the mapping of predicted probability columns to original class labels. ```R print(sl_isotonic) ``` -------------------------------- ### Printing Multiclass Beta Calibration Estimates for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-beta.md This snippet demonstrates printing the results of a multiclass beta calibration (using a 1-vs-All approach) applied to `tune_results`. It details the calibration method, type, source class, data points, and the multiple truth and estimate variables involved in the multiclass calibration. ```R print(mtnl_beta) ``` -------------------------------- ### Printing GAM Calibration for Tune Results Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet prints the results of a generalized additive model (GAM) calibration object (`tl_smth_multi`) for multiclass probability estimation from `tune_results`. The output indicates the method is 'Generalized additive model calibration', type 'Multiclass', from 'Tune Results' with 5,000 data points split in 10 groups. The truth variable is `class`, and the estimate variables are `.pred_one`, `.pred_two`, and `.pred_three`. ```R print(tl_smth_multi) ``` -------------------------------- ### Displaying Isotonic Binary Calibration for Tune Results (tl_isotonic) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-isotonic.md Displays the results of an isotonic regression calibration for binary classification on `tune_results`. This shows how calibration estimates are presented when derived from tuning outputs, including details on data points and estimate variables. ```R print(tl_isotonic) ``` -------------------------------- ### Printing Multiclass Bootstrapped Isotonic Regression Calibration for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet displays the summary of a bootstrapped isotonic regression calibration model (`mtnl_isotonic`) for multiclass (1 vs All) classification, applied to `tune_results`. The summary shows the calibration method, type, source, data points split into 10 groups, and the truth (`class`) and estimate variables (`.pred_one`, `.pred_two`, `.pred_three`) for multiple classes. ```R print(mtnl_isotonic) ``` -------------------------------- ### Displaying Isotonic Multiclass Calibration for Tune Results (mtnl_isotonic) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-isotonic.md Displays the results of an isotonic regression calibration for multiclass classification (1 vs All) on `tune_results`. It provides a summary of the calibration method, data source, and the mapping of predicted probability columns for multiple classes. ```R print(mtnl_isotonic) ``` -------------------------------- ### Printing Multiclass Isotonic Calibration Estimates for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md Demonstrates the output of multiclass isotonic regression calibration (1-vs-All strategy) applied to `tune_results`. This snippet highlights the method's ability to handle more than two class levels, with separate estimate variables for each class. ```R print(mtnl_isotonic) ``` -------------------------------- ### Printing Logistic Calibration Estimates for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md Demonstrates the output of logistic regression calibration applied to a data frame. It shows the method, type (binary), source class, number of data points, truth variable (`Class`), and estimate variables (`.pred_good`, `.pred_poor`). This is a standard output for successful binary classification calibration. ```R print(sl_logistic) ``` -------------------------------- ### Printing No Calibration Binary Probability Results (Tune Results) - R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-none.md This snippet displays the output of a 'no calibration' method for binary probability calibration using `tune_results`. It details the calibration type, source class, data points (split into groups), truth variable, and the estimate variables for each class. ```R print(nope_binary) ``` -------------------------------- ### Retrieving Default Conformal Control Options in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet uses `dput()` to display the default configuration options for conformal prediction, as provided by `control_conformal_full()`. It shows parameters like `method`, `trial_points`, `max_iter`, and `tolerance` that govern the conformal prediction process. ```R dput(control_conformal_full()) ``` -------------------------------- ### Handling Missing Required Package in `int_conformal_full` (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet shows an error when `int_conformal_full` is called with a `control_conformal_full` object specifying a non-existent or missing required package ('boop'). It highlights the dependency check mechanism within the function. ```R int_conformal_full(wflow, sim_data, control = control_conformal_full( required_pkgs = "boop")) ``` -------------------------------- ### Displaying Bootstrapped Isotonic Binary Calibration for Tune Results (tl_isotonic) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-isotonic.md Displays the results of a bootstrapped isotonic regression calibration for binary classification on `tune_results`. This shows how bootstrapped calibration estimates are presented when derived from tuning outputs, including details on data points and estimate variables. ```R print(tl_isotonic) ``` -------------------------------- ### Printing Binary Beta Calibration Estimates for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-beta.md This snippet demonstrates printing the results of a binary beta calibration applied to a data frame. It shows the method used (Beta calibration), the type (Binary), the source class (Data Frame), the number of data points, and the truth and estimate variables involved in the calibration. ```R print(sl_beta) ``` -------------------------------- ### Displaying Grouped Isotonic Binary Calibration for Data Frame (sl_isotonic_group) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-isotonic.md Displays the results of an isotonic regression calibration for binary classification on a grouped data frame. This demonstrates the calibration applied across groups, noting that the `.by` argument for grouping is limited to a single column. ```R print(sl_isotonic_group) ``` -------------------------------- ### Printing Grouped Beta Calibration for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet displays the summary of a beta calibration model (`sl_beta_group`) applied to a grouped data frame for binary classification. The summary indicates that the data is split into 2 groups, offering context on how the calibration performs across these subsets. ```R print(sl_beta_group) ``` -------------------------------- ### Displaying Grouped Bootstrapped Isotonic Binary Calibration for Data Frame (sl_boot_group) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-isotonic.md Displays the results of a bootstrapped isotonic regression calibration for binary classification on a grouped data frame. This demonstrates the bootstrapped calibration applied across groups, noting that the `.by` argument for grouping is limited to a single column. ```R print(sl_boot_group) ``` -------------------------------- ### Displaying Bootstrapped Isotonic Multiclass Calibration for Tune Results (mtnl_isotonic) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-isotonic.md Displays the results of a bootstrapped isotonic regression calibration for multiclass classification (1 vs All) on `tune_results`. It provides a summary of the bootstrapped calibration method, data source, and the mapping of predicted probability columns for multiple classes. ```R print(mtnl_isotonic) ``` -------------------------------- ### Printing Linear Calibration Results for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This R snippet prints the results of a linear regression calibration model (`tl_linear`) where the source data originated from `tune_results`. The output details the calibration method, source class, and how data points are organized across groups from the tuning process. ```R print(tl_linear) ``` -------------------------------- ### Printing Isotonic Regression Calibration for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet demonstrates printing the summary of an isotonic regression calibration model (`sl_logistic`) applied to a data frame. The output details the calibration method, type (Regression), source class (Data Frame), number of data points, unique predicted values, and the truth (`outcome`) and estimate (`.pred`) variables. ```R print(sl_logistic) ``` -------------------------------- ### Printing Bootstrapped Isotonic Regression Calibration for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet prints the summary of a bootstrapped isotonic regression calibration model (`tl_isotonic`) when applied to `tune_results` for binary classification. The output indicates the calibration method, type (Binary), source class (Tune Results), data points split into 8 groups, and the truth (`class`) and estimate (`.pred_class_1`, `.pred_class_2`) variables. ```R print(tl_isotonic) ``` -------------------------------- ### Printing GAM Calibration for Data Frame Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet prints the results of a generalized additive model (GAM) calibration object (`sp_smth_multi`) for multiclass probability estimation from a data frame. The output indicates the method is 'Generalized additive model calibration', type 'Multiclass', from a 'Data Frame' with 110 data points. The truth variable is `Species`, and the estimate variables are `.pred_bobcat`, `.pred_coyote`, and `.pred_gray_fox`. ```R print(sp_smth_multi) ``` -------------------------------- ### Printing GAM Calibration (Tune Results) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-multinomial.md Shows the summary of a `probably` generalized additive model (GAM) calibration object (`tl_smth_multi`) for multiclass probabilities on `tune_results`. The output specifies the GAM calibration method, data source, total data points split into 10 groups, the `class` truth variable, and the corresponding prediction variables. ```R print(tl_smth_multi) ``` -------------------------------- ### Printing Linear Calibration Results for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This R snippet prints the results of a linear regression calibration model (`sl_linear`) that was fitted on a standard data frame. The output provides details on the calibration method, source class, number of data points, and the truth and estimate variables used. ```R print(sl_linear) ``` -------------------------------- ### Displaying Linear Calibration for Data Frame in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-linear.md This snippet prints the summary of `sl_linear`, an object representing a linear regression calibration model. It shows the calibration method, source data class (Data Frame), number of data points, and the variables used for truth (`outcome`) and estimate (`.pred`). This output helps verify the successful application of linear calibration to a standard data frame. ```R print(sl_linear) ``` -------------------------------- ### Printing Grouped Binary Beta Calibration Estimates for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-beta.md This snippet illustrates printing the results of a binary beta calibration applied to a data frame that has been split into groups. It provides details on the calibration method, type, source class, and the number of data points, explicitly noting the grouping. ```R print(sl_beta_group) ``` -------------------------------- ### Output: Split Conformal Quantile Regression Model Summary (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals-quantile.md This output displays a summary of an `lm_int` object, which represents a split conformal inference model using quantile regression. It details the preprocessor (formula), the underlying model (linear regression with `lm` engine), the size of the calibration set, and the confidence level. It also provides a hint to use `predict(object, new_data)` for computing prediction intervals. ```R lm_int Output Split Conformal inference via Quantile Regression preprocessor: formula model: linear_reg (engine = lm) calibration set size: 100 confidence level: 0.9 Use `predict(object, new_data)` to compute prediction intervals ``` -------------------------------- ### Displaying Split Conformal Inference Object (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals-split.md This snippet displays the `lm_int` object, which represents a trained split conformal inference model. The output provides a summary of the model's configuration, including the preprocessor (formula), the underlying model (linear_reg with lm engine), and the size of the calibration set used. It also hints at how to use the object for predictions. ```R lm_int ``` -------------------------------- ### Printing No Calibration Regression Results (Tune Results) - R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-none.md This snippet prints the results of a 'no calibration' regression model when the source data is from `tune_results`. It specifies the method, data source, number of data points (split into groups), and the truth and estimate variables used. ```R print(nope_reg) ``` -------------------------------- ### Printing Logistic Calibration Estimates for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md Illustrates the output of logistic regression calibration when applied to `tune_results` objects. It specifies the source class as 'Tune Results' and indicates a larger number of data points split into more groups, typical for cross-validation or resampling outputs. ```R print(tl_logistic) ``` -------------------------------- ### Inspecting a `probably` Conformal Inference Object (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet displays the structure and summary of a `basic_obj`, which is a `probably` conformal inference object. It indicates the preprocessor (formula), the underlying model (linear regression with `lm` engine), and the training set size, along with instructions for computing prediction intervals. ```R basic_obj ``` -------------------------------- ### Printing Grouped Bootstrapped Isotonic Regression Calibration for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet displays the summary of a bootstrapped isotonic regression calibration model (`sl_boot_group`) applied to a grouped data frame for binary classification. The output highlights that the data is split into 2 groups, providing context for the calibration's performance across these groups. ```R print(sl_boot_group) ``` -------------------------------- ### Printing Grouped Isotonic Calibration Estimates for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md Shows the output of isotonic regression calibration applied to a grouped data frame. It includes the 'Unique Predicted Values' per group and confirms the split in data points, demonstrating grouped isotonic calibration. ```R print(sl_isotonic_group) ``` -------------------------------- ### Printing Linear Spline Calibration Results for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This R snippet prints the results of a generalized additive model (GAM) calibration (`tl_gam`) when the source data is from `tune_results`. The output details the calibration method, source class, and how data points are organized across groups from the tuning process. ```R print(tl_gam) ``` -------------------------------- ### Printing Grouped Logistic Calibration Estimates for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md Shows the output of logistic regression calibration applied to a grouped data frame. Similar to the non-grouped version, but indicates the data points are split into multiple groups, implying a `.by` argument was used for grouping. This highlights the ability to perform calibration on subsets of data. ```R print(sl_logistic_group) ``` -------------------------------- ### Printing No Calibration Binary Probability Results (Data Frame) - R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-none.md This snippet displays the output of a 'no calibration' method for binary probability calibration using a data frame. It details the calibration type, source class, data points, truth variable, and the specific estimate variables for each class. ```R print(nope_binary) ``` -------------------------------- ### Printing Logistic Calibration Estimates for Tune Results (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-logistic.md This snippet prints the results of a logistic regression calibration when applied to `tune_results` objects. It shows that the calibration method works with results from tuning processes, handling 4,000 data points split into 8 groups. It outlines the calibration method, type, and the variables involved. ```R print(tl_logistic) ``` -------------------------------- ### Displaying Grouped Isotonic Regression Calibration for Data Frame (sl_logistic_group) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-isotonic.md Displays the results of an isotonic regression calibration for a regression problem on a grouped data frame. This demonstrates the calibration applied across groups, noting that the `.by` argument for grouping is limited to a single column. ```R print(sl_logistic_group) ``` -------------------------------- ### Printing Logistic Calibration Estimates for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-logistic.md This snippet prints the results of a logistic regression calibration performed on a data frame. It shows details like the calibration method, type (binary), source class, number of data points, and the truth and estimate variables used for calibration. It demonstrates successful application of logistic calibration. ```R print(sl_logistic) ``` -------------------------------- ### Printing GAM Calibration Estimates for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-logistic.md This snippet prints the results of a Generalized Additive Model (GAM) calibration performed on a data frame. It confirms the successful application of spline-based calibration, detailing the method, binary type, source class, data points, and the truth and estimate variables used. ```R print(sl_gam) ``` -------------------------------- ### Printing Logistic Spline Calibration Estimates for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md Displays the output of generalized additive model (GAM) calibration, also known as logistic spline calibration, applied to a data frame. It confirms the method and binary type, showing the standard calibration details for this approach. ```R print(sl_gam) ``` -------------------------------- ### Printing Multinomial Regression Calibration for Tune Results Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet prints the results of a multinomial regression calibration object (`tl_multi`) when the source data is from `tune_results`. The output shows the method as 'Multinomial regression calibration', type 'Multiclass', from 'Tune Results' with 5,000 data points split in 10 groups. The truth variable is `class`, and the estimate variables are `.pred_one`, `.pred_two`, and `.pred_three`. ```R print(tl_multi) ``` -------------------------------- ### Printing Grouped Logistic Spline Calibration Estimates for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md Shows the output of GAM calibration applied to a grouped data frame, indicating that the calibration was performed separately for different data subsets. This demonstrates the flexibility of applying spline-based calibration to grouped data. ```R print(sl_gam_group) ``` -------------------------------- ### Printing No Calibration Multiclass Probability Results (Tune Results) - R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-none.md This snippet prints the results of a 'no calibration' method for multiclass probability calibration, sourced from `tune_results`. It outlines the calibration type, source class, data points (split into groups), truth variable, and the estimate variables corresponding to each class. ```R print(nope_multi) ``` -------------------------------- ### Displaying Isotonic Regression Calibration for Data Frame (sl_logistic) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-isotonic.md Displays the results of an isotonic regression calibration for a regression problem on a data frame. It summarizes the calibration method, data source, and the mapping of the predicted value column to the outcome variable. ```R print(sl_logistic) ``` -------------------------------- ### Printing No Calibration Regression Results (Data Frame) - R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-none.md This snippet prints the results of a 'no calibration' regression model when the source data is a data frame. It shows the method used, data source, number of data points, and the truth and estimate variables involved in the calibration. ```R print(nope_reg) ``` -------------------------------- ### Displaying Spline Calibration for Tune Results in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-linear.md This snippet prints the summary of `tl_gam`, a GAM-based calibration model derived from `tune_results`. The output confirms 'Generalized additive model calibration', `Tune Results` as the source class, and that the data was split into 10 groups, along with `outcome` and `.pred` variables. This illustrates how spline calibration results are summarized when integrated with resampling outputs. ```R print(tl_gam) ``` -------------------------------- ### Displaying Spline Calibration for Data Frame in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-linear.md This snippet prints the summary of `sl_gam`, an object representing a generalized additive model (GAM) based calibration. It details the method ('Generalized additive model calibration'), source class (Data Frame), data points, and the `outcome` and `.pred` variables. This output confirms the application of spline-based calibration to a standard data frame. ```R print(sl_gam) ``` -------------------------------- ### Printing Isotonic Calibration Estimates for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md Illustrates the output of isotonic regression calibration applied to a data frame. This method is non-parametric and includes 'Unique Predicted Values' in its output, indicating the number of distinct probability predictions used for calibration. ```R print(sl_isotonic) ``` -------------------------------- ### Printing Grouped Isotonic Regression Calibration for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet displays the summary of an isotonic regression calibration model (`sl_logistic_group`) applied to a data frame that has been implicitly grouped. The output indicates the data points are split into 10 groups, providing insights into the calibration's behavior across different data subsets. ```R print(sl_logistic_group) ``` -------------------------------- ### Printing Multinomial Regression Calibration (Tune Results) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-multinomial.md Displays the summary of a `probably` multinomial regression calibration object (`tl_multi`) derived from `tune_results`. This output details the calibration method, type (multiclass), source class (`Tune Results`), number of data points split into 10 groups, the `class` truth variable, and the specific estimate variables (`.pred_one`, `.pred_two`, `.pred_three`). ```R print(tl_multi) ``` -------------------------------- ### Handling Internal Errors in `probably:::get_root` (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet demonstrates how an internal utility function, `probably:::get_root`, handles errors during its search process. It shows that if an error occurs (simulated here by `stop()`), a warning is issued, and the function returns `NA`, indicating a failure to complete the operation. ```R probably:::get_root(try(stop("I made you stop"), silent = TRUE), control_conformal_full()) ``` -------------------------------- ### Printing Linear Spline Calibration Results for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This R snippet prints the results of a generalized additive model (GAM) calibration (`sl_gam`), often referred to as linear spline calibration, applied to a standard data frame. It provides information on the calibration method, source class, data points, and variables used. ```R print(sl_gam) ``` -------------------------------- ### Displaying Linear Calibration for Tune Results in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-linear.md This snippet prints the summary of `tl_linear`, a linear regression calibration model derived from `tune_results`. The output confirms linear calibration, `Tune Results` as the source class, and that the data was split into 10 groups, along with the `outcome` and `.pred` variables. This illustrates how calibration results are summarized when integrated with resampling outputs. ```R print(tl_linear) ``` -------------------------------- ### Inspecting a `probably` Conformal Inference CV+ Object (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet displays the structure and summary of a `basic_cv_obj`, which represents a conformal inference object derived via CV+. It details the preprocessor, model, number of models used in cross-validation, and training set size, along with instructions for prediction. ```R basic_cv_obj ``` -------------------------------- ### Printing No Calibration Multiclass Probability Results (Data Frame) - R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-none.md This snippet prints the results of a 'no calibration' method for multiclass probability calibration, sourced from a data frame. It outlines the calibration type, source class, data points, truth variable, and the estimate variables corresponding to each class. ```R print(nope_multi) ``` -------------------------------- ### Performing Isotonic Regression Calibration with Custom Column Names (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This R snippet demonstrates using the `cal_estimate_isotonic` function for probability calibration. It specifies `new_segment` as the input data, `Class` as the truth variable, and `c(good, poor)` as the estimate variables, showcasing how to use non-default column names for the estimates. ```R cal_estimate_isotonic(new_segment, Class, c(good, poor)) ``` -------------------------------- ### Displaying Grouped Linear Calibration for Data Frame in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-linear.md This snippet prints the summary of `sl_linear_group`, a linear regression calibration model applied to a grouped data frame. The output indicates linear calibration, Data Frame source, and that the data was split into 2 groups, along with the truth (`outcome`) and estimate (`.pred`) variables. It demonstrates how linear calibration results are presented when applied with grouping. ```R print(sl_linear_group) ``` -------------------------------- ### Printing No Calibration Grouped Regression Results (Data Frame) - R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-none.md This snippet prints the results of a 'no calibration' regression model applied to a grouped data frame. It indicates the method, data source, and that the data points are split into groups, along with the truth and estimate variables. ```R print(nope_reg_group) ``` -------------------------------- ### Printing GAM Calibration (Data Frame) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-multinomial.md Shows the summary of a `probably` generalized additive model (GAM) calibration object (`sp_smth_multi`) for multiclass probabilities on a data frame. The output specifies the GAM calibration method, data source, total data points, the `Species` truth variable, and the corresponding prediction variables. ```R print(sp_smth_multi) ``` -------------------------------- ### Displaying Grouped Spline Calibration for Data Frame in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-linear.md This snippet prints the summary of `sl_gam_group`, a GAM-based calibration model applied to a grouped data frame. The output specifies 'Generalized additive model calibration', Data Frame source, and that the data was split into 2 groups, along with `outcome` and `.pred` variables. It shows how spline calibration results are presented when applied with grouping. ```R print(sl_gam_group) ``` -------------------------------- ### Error: Unexpected Argument 'level' (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals-quantile.md This error indicates that the function was called with an unexpected argument, `level = 0.9`, in a context where the `...` (dots) argument should be empty. This suggests that the `level` argument is either not supported by the function or is being passed incorrectly, possibly due to a mismatch in function signature or an attempt to pass arguments that are not consumed by the method. ```R `...` must be empty. x Problematic argument: * level = 0.9 ``` -------------------------------- ### Printing Grouped Linear Spline Calibration Results for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This R snippet prints the results of a generalized additive model (GAM) calibration (`sl_gam_group`) applied to a data frame with grouped data. The output confirms the method, source class, and that data points are split into groups, along with the truth and estimate variables. ```R print(sl_gam_group) ``` -------------------------------- ### Printing Multinomial Regression Calibration (Data Frame) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-multinomial.md Displays the summary of a `probably` multinomial regression calibration object (`sp_multi`) applied to a data frame. This output details the calibration method, type (multiclass), source class, number of data points, the truth variable (`Species`), and the specific estimate variables (`.pred_bobcat`, `.pred_coyote`, `.pred_gray_fox`). ```R print(sp_multi) ``` -------------------------------- ### Error: No Applicable Method for int_conformal_quantile (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals-quantile.md This error indicates that the `int_conformal_quantile` function does not have a defined method for objects of class `lm`. This typically occurs when attempting to apply a function designed for a specific model type to an incompatible object, suggesting a need to ensure the model object is of the correct class or that the function supports `lm` objects. ```R no applicable method for 'int_conformal_quantile' applied to an object of class "lm" ``` -------------------------------- ### Handling Insufficient Unique Observations for Linear Spline Calibration Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This R code attempts to estimate a linear calibration model using `cal_estimate_linear` with `smooth = TRUE` (indicating a spline-based approach). However, due to too few unique observations in the input data (`boosting_predictions_oob`, `outcome`), the function issues a warning: 'Warning:\nToo few unique observations for spline-based calibrator. Setting `smooth = FALSE`.' and automatically reverts to a non-spline, linear calibration. ```R sl_gam <- cal_estimate_linear(boosting_predictions_oob, outcome, smooth = TRUE) ``` -------------------------------- ### Printing Multinomial Regression Calibration for Data Frame Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet prints the results of a multinomial regression calibration object (`sp_multi`) when the source data is a data frame. The output shows that the calibration method is 'Multinomial regression calibration', it's a 'Multiclass' type, sourced from a 'Data Frame' with 110 data points. The truth variable is `Species`, and the estimate variables are `.pred_bobcat`, `.pred_coyote`, and `.pred_gray_fox`. ```R print(sp_multi) ``` -------------------------------- ### Printing Grouped Multinomial Regression Calibration for Data Frame Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This snippet prints the results of a multinomial regression calibration object (`sl_multi_group`) where the data frame input was split into 2 groups. The output confirms the method as 'Multinomial regression calibration', type 'Multiclass', from a 'Data Frame' with 110 data points split in 2 groups. The truth variable is `Species`, and the estimate variables are `.pred_bobcat`, `.pred_coyote`, and `.pred_gray_fox`. ```R print(sl_multi_group) ``` -------------------------------- ### Handling Missing Predictor Columns in `predict` (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet demonstrates an error during prediction when the `new_data` provided to `predict` is missing essential predictor columns required by the model. The `hardhat::forge()` function, used internally, identifies and reports the missing columns. ```R predict(basic_obj, sim_new[, 3:5]) ``` -------------------------------- ### Printing Grouped Linear Calibration Results for Data Frame (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This R snippet prints the results of a linear regression calibration model (`sl_linear_group`) applied to a data frame with grouped data. The output indicates that the data points are split into multiple groups, along with the standard calibration details. ```R print(sl_linear_group) ``` -------------------------------- ### Handling Missing Training Data Columns in `int_conformal_full` (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet shows an error when `int_conformal_full` is called with `train_data` that lacks required predictor columns. Similar to prediction, the internal `hardhat::forge()` function validates the completeness of the training data, ensuring all necessary features are present. ```R int_conformal_full(wflow, train_data = sim_cls_data) ``` -------------------------------- ### Handling Incorrect Object Type for `int_conformal_cv` (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet demonstrates an error when `int_conformal_cv` is called with an unfitted `workflow()` object. It indicates that `int_conformal_cv` expects a specific type of object, likely a `resamples` or `tune_results` object, not a raw workflow. ```R int_conformal_cv(workflow()) ``` -------------------------------- ### Validating Fitted Workflow Object in `int_conformal_full` (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet demonstrates an error when `int_conformal_full` receives an unfitted `workflow()` object. It emphasizes the requirement for the input `object` to be a properly fitted workflow, crucial for the function's operation. ```R int_conformal_full(workflow(), sim_new) ``` -------------------------------- ### Handling Incorrect Object Type for `int_conformal_full` (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet illustrates an error when `int_conformal_full` is called with an object that is not a `workflow` but rather a `parsnip` model fit extracted from a workflow. It highlights that `int_conformal_full` expects a workflow object, not just the underlying model fit. ```R int_conformal_full(extract_fit_parsnip(wflow), sim_new) ``` -------------------------------- ### Attempting Out-of-Bounds Vector Slicing in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/class-pred.md This R code snippet demonstrates an attempt to slice a vector (`manual_creation_eq`) from index 1 to 6. The accompanying error message indicates that the vector only contains 5 elements, resulting in an 'out of bounds' error when trying to access the non-existent 6th element. This highlights the importance of checking vector lengths before slicing. ```R manual_creation_eq[1:6] ``` -------------------------------- ### Predicting Conformal Intervals with `predict` in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet demonstrates how to generate conformal prediction intervals using the `predict` function with a fitted model object (`smol_obj`) and new data (`sim_new`). It often produces warnings related to `uniroot()` convergence, indicating potential issues with interval calculation. ```R res_small <- predict(smol_obj, sim_new) ``` -------------------------------- ### Error: Missing Required Column 'predictor_01' (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals-quantile.md This error message signifies that the input data is missing a crucial column named `predictor_01`, which is required for the operation. This often occurs during prediction or calibration when the new data does not contain all the necessary features used during model training. ```R The required column "predictor_01" is missing. ``` -------------------------------- ### Customizing Conformal Control Options (`max_iter`) in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet demonstrates how to override a default parameter, specifically `max_iter`, when initializing conformal control options using `control_conformal_full()`. The `dput()` output confirms that `max_iter` is set to 2, while other parameters retain their defaults. ```R dput(control_conformal_full(max_iter = 2)) ``` -------------------------------- ### Validating Missing `.extracts` Column in `int_conformal_cv` (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet demonstrates an error when `int_conformal_cv` is used with a result object (`good_res`) that lacks the `.extracts` column. This column is essential as it contains the fitted workflow objects, and its absence prevents the function from operating correctly. Users are advised to check the `extract` argument in control functions. ```R int_conformal_cv(dplyr::select(good_res, -.extracts)) ``` -------------------------------- ### Computing Prediction Intervals with Split Conformal Model (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals-split.md This snippet demonstrates how to use the `predict()` function with a split conformal inference object to compute prediction intervals. It requires the trained `object` (the `lm_int` model), `new_data` (a data frame of new observations), and `level` (the desired confidence level for the interval, e.g., 0.95). ```R predict(object, new_data, level) ``` -------------------------------- ### Handling Insufficient Unique Observations for Multinomial Spline Calibration Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This R code attempts to estimate a multinomial calibration model using `cal_estimate_multinomial` with `smooth = TRUE`. If there are insufficient unique observations in the input data (`smol_species_probs`, `Species`), the function issues a warning: 'Warning:\nToo few unique observations for spline-based calibrator. Setting `smooth = FALSE`.' and automatically switches to a non-spline, multinomial regression calibration. ```R sl_gam <- cal_estimate_multinomial(smol_species_probs, Species, smooth = TRUE) ``` -------------------------------- ### Handling Missing Predictor Columns in `predict` for CV+ Object (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet shows an error during prediction with a `basic_cv_obj` when the `new_data` is missing required predictor columns. The error propagates from `hardhat::forge()` within an internal `map()` call, indicating that data validation is performed for each model in the CV+ ensemble. ```R predict(basic_cv_obj, sim_new[, 3:5]) ``` -------------------------------- ### Handling Model Estimation Failure in `int_conformal_full` (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet demonstrates an error when `int_conformal_full` fails due to an underlying model estimation issue, specifically when a term has insufficient unique covariate combinations for the specified degrees of freedom. This indicates a problem with the model's ability to fit the data for interval length estimation. ```R int_conformal_full(wflow, sim_new) ``` -------------------------------- ### Validating Regression Model Type in `int_conformal_full` (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet shows an error when `int_conformal_full` is used with a `workflow` (`wflow_cls`) that contains a classification model. It clarifies that `int_conformal_full` is specifically designed for regression models and will error if a classification model is provided. ```R int_conformal_full(wflow_cls, sim_cls_new) ``` -------------------------------- ### Calling bound_prediction without .pred column (lower_limit) - R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/bound-prediction.md This R code attempts to use `bound_prediction` with `modeldata::solubility_test` and a `lower_limit`. It fails because the input data frame `x` (here `modeldata::solubility_test`) is missing the required `.pred` column, which is essential for the function to operate on predictions. ```R bound_prediction(modeldata::solubility_test, lower_limit = 2) ``` -------------------------------- ### Handling Invalid Conformal Method Input in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet illustrates an error condition when an invalid value is provided for the `method` argument of `control_conformal_full()`. The error message clearly states that `method` must be either 'iterative' or 'grid', preventing unsupported methods from being used. ```R control_conformal_full(method = "rock-paper-scissors") ``` -------------------------------- ### Validating Missing `.predictions` Column in `int_conformal_cv` (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet shows an error when `int_conformal_cv` is provided with a result object (`good_res`) from which the `.predictions` column has been removed. It highlights the critical dependency on this column, which holds holdout predictions, and advises checking `save_pred` in control functions. ```R int_conformal_cv(dplyr::select(good_res, -.predictions)) ``` -------------------------------- ### Printing Grouped Multinomial Regression Calibration (Data Frame) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-multinomial.md Presents the summary of a `probably` multinomial regression calibration object (`sl_multi_group`) applied to a data frame that has been explicitly split into two groups. The output indicates the calibration method, multiclass type, data frame source, total data points, the `Species` truth variable, and the estimate variables, noting the data is split across groups. ```R print(sl_multi_group) ``` -------------------------------- ### Handling Insufficient Unique Observations for Grouped Linear Spline Calibration Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This R code attempts to estimate a linear calibration model using `cal_estimate_linear` with `smooth = TRUE` and grouping by `id`. If any group has too few unique observations, the function issues a warning: 'Warning:\nToo few unique observations for spline-based calibrator. Setting `smooth = FALSE`.' and reverts to a non-spline, linear calibration for the affected groups. ```R sl_gam <- cal_estimate_linear(boosting_predictions_oob, outcome, .by = id, smooth = TRUE) ``` -------------------------------- ### Calculating Conformal CV Intervals with `int_conformal_cv` in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/conformal-intervals.md This snippet attempts to calculate cross-validated conformal intervals using `int_conformal_cv`. The accompanying error indicates that the `parameters` argument implicitly selected multiple submodels, but `int_conformal_cv` expects only a single submodel to be selected for interval calculation. ```R int_conformal_cv(grid_res, two_models) ``` -------------------------------- ### Grouped Logistic Spline Calibration Fallback to Linear (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-logistic.md This snippet illustrates the fallback mechanism for grouped spline-based logistic calibration. When `smooth = TRUE` is used with `.by` grouping, and there are too few unique observations within groups, the method reverts to a linear calibrator, issuing warnings for each affected group. ```R sl_gam <- cal_estimate_logistic(segment_logistic, Class, .by = id, smooth = TRUE) ``` -------------------------------- ### Demonstrating Lossy Cast Error in class_pred Objects (R) Source: https://github.com/tidymodels/probably/blob/main/NEWS.md This R code snippet illustrates a breaking change introduced in 'probably' version 0.0.3, where attempting to cast a `class_pred` object (`x`) to another `class_pred` object (`to`) with incompatible levels now results in an error, consistent with `vctrs` package behavior. Previously, this operation would only issue a warning. The snippet shows the creation of two `class_pred` objects and the `vec_cast()` function call that triggers the error. ```R x <- class_pred(factor("a")) to <- class_pred(factor("to")) vec_cast(x, to) ``` -------------------------------- ### Automatic Fallback to Linear Calibration for Splines in R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-linear.md This snippet attempts to perform spline-based calibration using `cal_estimate_linear` with `smooth = TRUE`. However, if there are insufficient unique observations in `boosting_predictions_oob` for the `outcome` variable, the function automatically defaults to linear calibration (`smooth = FALSE`), issuing a warning. This demonstrates the function's robustness in adapting to data limitations for spline models. ```R sl_gam <- cal_estimate_linear(boosting_predictions_oob, outcome, smooth = TRUE) ``` -------------------------------- ### Handling Insufficient Unique Observations for Grouped Multinomial Spline Calibration Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate.md This R code attempts to estimate a multinomial calibration model using `cal_estimate_multinomial` with `smooth = TRUE` and grouping by `id`. If any group lacks enough unique observations, the function issues a warning: 'Warning:\nToo few unique observations for spline-based calibrator. Setting `smooth = FALSE`.' and reverts to a non-spline, multinomial regression calibration for the affected groups. ```R sl_gam <- cal_estimate_multinomial(smol_by_species_probs, Species, .by = id, smooth = TRUE) ``` -------------------------------- ### Logistic Spline Calibration Fallback to Linear (R) Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/cal-estimate-logistic.md This snippet demonstrates how `cal_estimate_logistic` with `smooth = TRUE` (for spline-based calibration) falls back to a linear model when there are insufficient unique observations. A warning is issued, indicating that `smooth` is automatically set to `FALSE` due to data limitations. ```R sl_gam <- cal_estimate_logistic(segment_logistic, Class, smooth = TRUE) ``` -------------------------------- ### Calling bound_prediction with non-numeric .pred column (lower_limit) - R Source: https://github.com/tidymodels/probably/blob/main/tests/testthat/_snaps/bound-prediction.md This R code attempts to use `bound_prediction` after creating a `.pred` column from `prediction` using `format()`. The function fails because the `.pred` column, although present, is not numeric, which is a prerequisite for bounding operations. ```R bound_prediction(mutate(modeldata::solubility_test, .pred = format(prediction)), lower_limit = 2) ```