14  add_numeric_ from call

ImportantDisclaimer

These packages (Note 1) are a one-person project undergoing rapid evolution. Backward compatibility (per Hadley Wickham) is provided as a courtesy rather than a guarantee.

Until further notice, these packages should

  • not be used as a basis for research grant applications,
  • not be cited as an actively maintained tool in a peer-reviewed manuscript,
  • not be used to support or fulfill requirements for pursuing an academic degree.

In addition, work primarily based on these packages (Note 1) should not be presented at academic conferences or similar scholarly venues.

Furthermore, a person’s ability to use these packages (Note 1) does not necessarily imply an understanding of their underlying mechanisms. Accordingly, demonstration of their use alone should not be considered sufficient evidence of expertise, nor should it be credited as a basis for academic promotion or advancement.

These statements do not apply to the contributors (Tip 1) to these packages (Note 1) with respect to their specific contributions.

These statements do not apply when the maintainer of these packages (Note 1), Tingting Zhan, is credited as the first author, the lead author, and/or the corresponding author in a peer-reviewed manuscript, or as the Principal Investigator or Co-Principal Investigator in a research grant application and/or a final research progress report.

These statements are advisory in nature and do not modify or restrict the rights granted under the GNU General Public License https://www.r-project.org/Licenses/.

Note

The examples in Chapter 14 require

library(maxEff)

🚧 Chapter 14 is being re-written English-wise. All code are correct here, though. Expected delivery by 2025-12-31.

The internal class 'add_numeric_' defined in package maxEff v0.2.4, GPL-2 inherits from the class 'call' and is assigned with additional attributes

The S3 method print.default() displays each 'add_numeric_' object.

Example: training models a0, 1st element
a0[[1L]]
Example: training models a0, 2nd element
a0[[2L]]

The S3 method with.hyperframe() (v3.7.3, GPL (>= 2)) obtains the selected numeric predictors by passing the call to parameter ee.

Example: 1st selected numeric predictor
s0 |>
  with(ee = a0[[1L]]) |> # ?spatstat.geom::with.hyperframe
  summary.default()
s1 |>
  with(ee = a0[[1L]]) |> # ?spatstat.geom::with.hyperframe
  summary.default()
Example: 2nd selected numeric predictor
s0 |>
  with(ee = a0[[2L]]) |> # ?spatstat.geom::with.hyperframe
  summary.default()
s1 |>
  with(ee = a0[[2L]]) |> # ?spatstat.geom::with.hyperframe
  summary.default()

The S3 method predict.add_numeric_() is the workhorse of the S3 method predict.add_numeric().

Example: predict.add_numeric_(); predicted models a1, 1st element
a0[[1L]] |> 
  predict(newdata = s1) |>
  identical(y = a1[[1L]]) |>
  stopifnot()
Example: predict.add_numeric_(); predicted models a1, 2nd element
a0[[2L]] |> 
  predict(newdata = s1) |>
  identical(y = a1[[2L]]) |>
  stopifnot()