|
423 | 423 | #'
|
424 | 424 | #' @description
|
425 | 425 | #' When it comes to serializing XGBoost models, it's possible to use R serializers such as
|
426 |
| -#' [save()] or [saveRDS()] to serialize an XGBoost R model, but XGBoost also provides |
| 426 | +#' [save()] or [saveRDS()] to serialize an XGBoost model object, but XGBoost also provides |
427 | 427 | #' its own serializers with better compatibility guarantees, which allow loading
|
428 | 428 | #' said models in other language bindings of XGBoost.
|
429 | 429 | #'
|
@@ -451,23 +451,24 @@ NULL
|
451 | 451 | #' not used for prediction / importance / plotting / etc.
|
452 | 452 | #' These R attributes are only preserved when using R's serializers.
|
453 | 453 | #'
|
454 |
| -#' In addition to the regular `xgb.Booster` objects producted by [xgb.train()], the |
455 |
| -#' function [xgboost()] produces a different subclass `xgboost`, which keeps other |
456 |
| -#' additional metadata as R attributes such as class names in classification problems, |
457 |
| -#' and which has a dedicated `predict` method that uses different defaults. XGBoost's |
| 454 | +#' In addition to the regular `xgb.Booster` objects produced by [xgb.train()], the |
| 455 | +#' function [xgboost()] produces objects with a different subclass `xgboost` (which |
| 456 | +#' inherits from `xgb.Booster`), which keeps other additional metadata as R attributes |
| 457 | +#' such as class names in classification problems, and which has a dedicated `predict` |
| 458 | +#' method that uses different defaults and takes different argument names. XGBoost's |
458 | 459 | #' own serializers can work with this `xgboost` class, but as they do not keep R
|
459 | 460 | #' attributes, the resulting object, when deserialized, is downcasted to the regular
|
460 | 461 | #' `xgb.Booster` class (i.e. it loses the metadata, and the resulting object will use
|
461 |
| -#' `predict.xgb.Booster` instead of `predict.xgboost`) - for these `xgboost` objects, |
| 462 | +#' [predict.xgb.Booster()] instead of [predict.xgboost()]) - for these `xgboost` objects, |
462 | 463 | #' `saveRDS` might thus be a better option if the extra functionalities are needed.
|
463 | 464 | #'
|
464 | 465 | #' Note that XGBoost models in R starting from version `2.1.0` and onwards, and
|
465 | 466 | #' XGBoost models before version `2.1.0`; have a very different R object structure and
|
466 | 467 | #' are incompatible with each other. Hence, models that were saved with R serializers
|
467 | 468 | #' like [saveRDS()] or [save()] before version `2.1.0` will not work with latter
|
468 | 469 | #' `xgboost` versions and vice versa. Be aware that the structure of R model objects
|
469 |
| -#' could in theory change again in the future, so XGBoost's serializers |
470 |
| -#' should be preferred for long-term storage. |
| 470 | +#' could in theory change again in the future, so XGBoost's serializers should be |
| 471 | +#' preferred for long-term storage. |
471 | 472 | #'
|
472 | 473 | #' Furthermore, note that using the package `qs` for serialization will require
|
473 | 474 | #' version 0.26 or higher of said package, and will have the same compatibility
|
|
0 commit comments