details_mlp_keras | R Documentation |
keras_mlp()
fits a single layer, feed-forward neural network.
For this engine, there are multiple modes: classification and regression
This model has 5 tuning parameters:
hidden_units
: # Hidden Units (type: integer, default: 5L)
penalty
: Amount of Regularization (type: double, default: 0.0)
dropout
: Dropout Rate (type: double, default: 0.0)
epochs
: # Epochs (type: integer, default: 20L)
activation
: Activation Function (type: character, default:
‘softmax’)
mlp( hidden_units = integer(1), penalty = double(1), dropout = double(1), epochs = integer(1), activation = character(1) ) %>% set_engine("keras") %>% set_mode("regression") %>% translate()
## Single Layer Neural Network Model Specification (regression) ## ## Main Arguments: ## hidden_units = integer(1) ## penalty = double(1) ## dropout = double(1) ## epochs = integer(1) ## activation = character(1) ## ## Computational engine: keras ## ## Model fit template: ## parsnip::keras_mlp(x = missing_arg(), y = missing_arg(), hidden_units = integer(1), ## penalty = double(1), dropout = double(1), epochs = integer(1), ## activation = character(1))
mlp( hidden_units = integer(1), penalty = double(1), dropout = double(1), epochs = integer(1), activation = character(1) ) %>% set_engine("keras") %>% set_mode("classification") %>% translate()
## Single Layer Neural Network Model Specification (classification) ## ## Main Arguments: ## hidden_units = integer(1) ## penalty = double(1) ## dropout = double(1) ## epochs = integer(1) ## activation = character(1) ## ## Computational engine: keras ## ## Model fit template: ## parsnip::keras_mlp(x = missing_arg(), y = missing_arg(), hidden_units = integer(1), ## penalty = double(1), dropout = double(1), epochs = integer(1), ## activation = character(1))
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 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.
The underlying model implementation does not allow for case weights.
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.
The “Fitting and Predicting with parsnip” article contains
examples
for mlp()
with the "keras"
engine.
Kuhn, M, and K Johnson. 2013. Applied Predictive Modeling. Springer.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.