tests/testthat/_snaps/model-nnet.md

returns the right output

Code
  rlang::expr_text(tf)
Output
  [1] "0.7 + case_when(0.1 + wt * 0.2 + hp * 0.3 < -15 ~ 0, 0.1 + wt * \n    0.2 + hp * 0.3 > 15 ~ 1, .default = 1/(1 + exp(-(0.1 + wt * \n    0.2 + hp * 0.3)))) * 0.8 + case_when(0.4 + wt * 0.5 + hp * \n    0.6 < -15 ~ 0, 0.4 + wt * 0.5 + hp * 0.6 > 15 ~ 1, .default = 1/(1 + \n    exp(-(0.4 + wt * 0.5 + hp * 0.6)))) * 0.9"

an ordered factor is rejected

Code
  tidypredict_fit(model)
Condition
  Error in `acceptable_lm()`:
  ! The treatment contrast is the only one supported at this time. Field(s) with an invalid contrast are: "f".

multiple non classification outputs are rejected

Code
  tidypredict_fit(model)
Condition
  Error in `parse_model()`:
  ! `tidypredict_fit()` does not support `nnet::nnet()` models with multiple outputs that are not a classification.

matrix interface fits are rejected

Code
  tidypredict_fit(model)
Condition
  Error in `parse_model()`:
  ! `tidypredict_fit()` does not support `nnet::nnet()` models fit with the matrix interface.
  i Refit the model with the formula interface, so that the names of the predictors are available.
Code
  parse_model(model)
Condition
  Error in `parse_model()`:
  ! `tidypredict_fit()` does not support `nnet::nnet()` models fit with the matrix interface.
  i Refit the model with the formula interface, so that the names of the predictors are available.

tidypredict_test errors for classification nnet models

Code
  tidypredict_test(model, iris)
Condition
  Error in `tidypredict_test()`:
  ! `tidypredict_test()` does not support classification `nnet::nnet()` models.
  i Use `tidypredict_fit()` directly for class predictions.

inline functions in the formula are rejected

Code
  tidypredict_fit(model)
Condition
  Error in `acceptable_lm()`:
  x Functions inside the formula are not supported.
  i Functions detected: "log".  Use `dplyr` transformations to prepare the data.


Try the tidypredict package in your browser

Any scripts or data that you put into this service are public.

tidypredict documentation built on Oct. 18, 2026, 5:06 p.m.