diff --git a/manuscript/05-agnostic-decomposition.Rmd b/manuscript/05-agnostic-decomposition.Rmd index d1ad13e6..dec4d2f9 100644 --- a/manuscript/05-agnostic-decomposition.Rmd +++ b/manuscript/05-agnostic-decomposition.Rmd @@ -26,7 +26,7 @@ $$y = \hat{f}(x_1, x_2) = 2 + e^{x_1} - x_2 + x_1 \cdot x_2$$ Think of the function as a machine learning model. We can visualize the function with a 3D plot or a heatmap with contour lines: -```{r, fig.cap = "Prediction surface of a function with two features $X_1$ and $X_2$."} +```{r decomp-example, fig.cap = "Prediction surface of a function with two features $X_1$ and $X_2$."} x1 = seq(from = -1, to = 1, length.out = 30) x2 = seq(from = -1, to = 1, length.out = 30) f = function(x1, x2){ @@ -64,7 +64,7 @@ The intercept is $\hat{f}_0\sim3.18$. Since the other components are functions, we can visualize them: -```{r, fig.cap = "Decomposition of a function."} +```{r decomp-example-continued, fig.cap = "Decomposition of a function."} pred.fun = function(model = NULL, newdata){ f(newdata$x1, newdata$x2) }