library(knitr) knitr::opts_chunk$set( fig.align = "center", fig.height = 5.5, fig.width = 6, warning = FALSE, collapse = TRUE, dev.args = list(pointsize = 10), out.width = "90%", par = TRUE ) knit_hooks$set(par = function(before, options, envir) { if (before && options$fig.show != "none") par(family = "sans", mar = c(4.1,4.1,1.1,1.1), mgp = c(3,1,0), tcl = -0.5) })
library(RMoE)
GRMoE (Gaussian Regularized Mixture-of-Experts) provides a penalized MLE for the regularized Normal Mixture of Experts. GRMoE consists of a mixture of K Normal expert regressors network) gated by a softmax gating network.
It was written in R Markdown, using the knitr package for production.
See help(package="RMoE") for further details.
data("gaussian") X <- as.matrix(gaussian[, -8]) y <- gaussian$V8
K <- 2 # Number of experts Lambda <- 5 Gamma <- 5 opt <- FALSE # opt = FALSE: proximal Newton; opt = TRUE: proximal Newton-type
grmoe <- GaussRMoE(Xm = X, Ym = y, K = K, Lambda = Lambda, Gamma = Gamma, option = opt, verbose = TRUE)
You can access to the parameters via the following commands:
# Regression coefficients for each expert grmoe$betak # Parameters of the gating network grmoe$wk
grmoe$plot(what = "loglik")
grmoe$plot(what = "zerocoefficients")
data("housing") X <- as.matrix(housing[, -15]) y <- housing$V15
K <- 2 # Number of experts Lambda <- 42 Gamma <- 10 opt <- FALSE # opt = FALSE: proximal Newton; opt = TRUE: proximal Newton-type
grmoe <- GaussRMoE(Xm = X, Ym = y, K = K, Lambda = Lambda, Gamma = Gamma, option = opt, verbose = TRUE)
You can access to the parameters via the following commands:
# Regression coefficients for each expert grmoe$betak # Parameters of the gating network grmoe$wk
grmoe$plot(what = "loglik")
grmoe$plot(what = "zerocoefficients")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.