Skip to content

Commit bc81160

Browse files
committed
revert nnet case weights
1 parent c75ed66 commit bc81160

File tree

8 files changed

+20
-36
lines changed

8 files changed

+20
-36
lines changed

R/mlp_data.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ set_fit(
233233
mode = "regression",
234234
value = list(
235235
interface = "formula",
236-
protect = c("formula", "data", "weights"),
236+
protect = c("formula", "data"),
237237
func = c(pkg = "nnet", fun = "nnet"),
238238
defaults = list(trace = FALSE)
239239
)
@@ -257,7 +257,7 @@ set_fit(
257257
mode = "classification",
258258
value = list(
259259
interface = "formula",
260-
protect = c("formula", "data", "weights"),
260+
protect = c("formula", "data"),
261261
func = c(pkg = "nnet", fun = "nnet"),
262262
defaults = list(trace = FALSE)
263263
)

R/multinom_reg_data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ set_fit(
282282
mode = "classification",
283283
value = list(
284284
interface = "formula",
285-
protect = c("formula", "data", "weights"),
285+
protect = c("formula", "data"),
286286
func = c(pkg = "nnet", fun = "multinom"),
287287
defaults = list(trace = FALSE)
288288
)

man/details_mlp_nnet.Rd

Lines changed: 5 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/details_multinom_reg_nnet.Rd

Lines changed: 2 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/rmd/mlp_nnet.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ mlp(
6464

6565
## Case weights
6666

67-
```{r child = "template-uses-case-weights.Rmd"}
67+
```{r child = "template-no-case-weights.Rmd"}
6868
```
6969

7070
## Examples

man/rmd/mlp_nnet.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ mlp(
4343
## Computational engine: nnet
4444
##
4545
## Model fit template:
46-
## nnet::nnet(formula = missing_arg(), data = missing_arg(), weights = missing_arg(),
47-
## size = integer(1), decay = double(1), maxit = integer(1),
48-
## trace = FALSE, linout = TRUE)
46+
## nnet::nnet(formula = missing_arg(), data = missing_arg(), size = integer(1),
47+
## decay = double(1), maxit = integer(1), trace = FALSE, linout = TRUE)
4948
```
5049

5150
Note that parsnip automatically sets linear activation in the last layer.
@@ -75,9 +74,8 @@ mlp(
7574
## Computational engine: nnet
7675
##
7776
## Model fit template:
78-
## nnet::nnet(formula = missing_arg(), data = missing_arg(), weights = missing_arg(),
79-
## size = integer(1), decay = double(1), maxit = integer(1),
80-
## trace = FALSE, linout = FALSE)
77+
## nnet::nnet(formula = missing_arg(), data = missing_arg(), size = integer(1),
78+
## decay = double(1), maxit = integer(1), trace = FALSE, linout = FALSE)
8179
```
8280

8381

@@ -93,9 +91,7 @@ scale each so that each predictor has mean zero and a variance of one.
9391
## Case weights
9492

9593

96-
This model can utilize case weights during model fitting. To use them, see the documentation in [case_weights] and the examples on `tidymodels.org`.
97-
98-
The `fit()` and `fit_xy()` arguments have arguments called `case_weights` that expect vectors of case weights.
94+
The underlying model implementation does not allow for case weights.
9995

10096
## Examples
10197

man/rmd/multinom_reg_nnet.Rmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ The "Fitting and Predicting with parsnip" article contains [examples](https://pa
4646

4747
## Case weights
4848

49-
```{r child = "template-uses-case-weights.Rmd"}
49+
```{r child = "template-no-case-weights.Rmd"}
5050
```
5151

52+
5253
## References
5354

5455
- Luraschi, J, K Kuo, and E Ruiz. 2019. _Mastering nnet with R_. O'Reilly Media

man/rmd/multinom_reg_nnet.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ multinom_reg(penalty = double(1)) %>%
3232
##
3333
## Model fit template:
3434
## nnet::multinom(formula = missing_arg(), data = missing_arg(),
35-
## weights = missing_arg(), decay = double(1), trace = FALSE)
35+
## decay = double(1), trace = FALSE)
3636
```
3737

3838
## Preprocessing requirements
@@ -51,9 +51,8 @@ The "Fitting and Predicting with parsnip" article contains [examples](https://pa
5151
## Case weights
5252

5353

54-
This model can utilize case weights during model fitting. To use them, see the documentation in [case_weights] and the examples on `tidymodels.org`.
54+
The underlying model implementation does not allow for case weights.
5555

56-
The `fit()` and `fit_xy()` arguments have arguments called `case_weights` that expect vectors of case weights.
5756

5857
## References
5958

0 commit comments

Comments
 (0)