Two-level HME (ESL eqs 9.25-9.30): softmax gates g_j(x), g_l|j(x) and Gaussian linear-regression (or logistic) experts; EM alternates branch posteriors with weighted least squares (weighted IRLS) for the experts and ridge-stabilised Newton fits of the gates on the posterior weights (Jordan & Jacobs 1994). An intercept is added; the start assigns softened blocks of the first input to the K^2 experts.
Usage
morie_esl_hme(
X,
y,
K = 2,
task = c("regression", "classification"),
max_iter = 500,
tol = 1e-10
)