forked from tidymodels/parsnip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetails_logistic_reg_keras.Rd
71 lines (61 loc) · 2.29 KB
/
details_logistic_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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/logistic_reg_keras.R
\name{details_logistic_reg_keras}
\alias{details_logistic_reg_keras}
\title{Logistic regression via keras}
\description{
\code{\link[=keras_mlp]{keras_mlp()}} fits a generalized linear model for binary outcomes. A
linear combination of the predictors is used to model the log odds of an
event.
}
\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{logistic_reg(penalty = double(1)) \%>\%
set_engine("keras") \%>\%
translate()
}\if{html}{\out{</div>}}\preformatted{## Logistic 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")
}
\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.model_spec()}}, 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{Examples}{
The “Fitting and Predicting with parsnip” article contains
\href{https://parsnip.tidymodels.org/articles/articles/Examples.html#logistic-reg-keras}{examples}
for \code{logistic_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}