forked from tidymodels/parsnip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetails_multinom_reg_keras.Rd
85 lines (69 loc) · 2.67 KB
/
details_multinom_reg_keras.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/multinom_reg_keras.R
\name{details_multinom_reg_keras}
\alias{details_multinom_reg_keras}
\title{Multinomial regression via keras}
\description{
\code{\link[=keras_mlp]{keras_mlp()}} fits a model that uses linear predictors to predict
multiclass data using the multinomial distribution.
}
\details{
For this engine, there is a single mode: classification
\subsection{Tuning Parameters}{
This model has one tuning parameter:
\itemize{
\item \code{penalty}: Amount of Regularization (type: double, default: 0.0)
}
For \code{penalty}, the amount of regularization is \emph{only} L2 penalty (i.e.,
ridge or weight decay).
}
\subsection{Translation from parsnip to the original package}{
\if{html}{\out{<div class="sourceCode r">}}\preformatted{multinom_reg(penalty = double(1)) \%>\%
set_engine("keras") \%>\%
translate()
}\if{html}{\out{</div>}}
\if{html}{\out{<div class="sourceCode">}}\preformatted{## Multinomial Regression Model Specification (classification)
##
## Main Arguments:
## penalty = double(1)
##
## Computational engine: keras
##
## Model fit template:
## parsnip::keras_mlp(x = missing_arg(), y = missing_arg(), penalty = double(1),
## hidden_units = 1, act = "linear")
}\if{html}{\out{</div>}}
\code{\link[=keras_mlp]{keras_mlp()}} is a parsnip wrapper around keras code for
neural networks. This model fits a linear regression as a network with a
single hidden unit.
}
\subsection{Preprocessing requirements}{
Factor/categorical predictors need to be converted to numeric values
(e.g., dummy or indicator variables) for this engine. When using the
formula method via \code{\link[=fit.model_spec]{fit()}}, parsnip will
convert factor columns to indicators.
Predictors should have the same scale. One way to achieve this is to
center and scale each so that each predictor has mean zero and a
variance of one.
}
\subsection{Case weights}{
The underlying model implementation does not allow for case weights.
}
\subsection{Saving fitted model objects}{
Models fitted with this engine may require native serialization methods
to be properly saved and/or passed between R sessions. To learn more
about preparing fitted models for serialization, see the bundle package.
}
\subsection{Examples}{
The “Fitting and Predicting with parsnip” article contains
\href{https://parsnip.tidymodels.org/articles/articles/Examples.html#multinom-reg-keras}{examples}
for \code{multinom_reg()} with the \code{"keras"} engine.
}
\subsection{References}{
\itemize{
\item Hoerl, A., & Kennard, R. (2000). \emph{Ridge Regression: Biased Estimation
for Nonorthogonal Problems}. Technometrics, 42(1), 80-86.
}
}
}
\keyword{internal}