From 5db1d20388c20e0407b9ac724ff11674016eb49d Mon Sep 17 00:00:00 2001 From: lisa-wm Date: Thu, 9 Nov 2023 08:56:19 +0100 Subject: [PATCH] test quarto --- content/team/01_test.qmd | 118 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 content/team/01_test.qmd diff --git a/content/team/01_test.qmd b/content/team/01_test.qmd new file mode 100644 index 0000000..914c4d8 --- /dev/null +++ b/content/team/01_test.qmd @@ -0,0 +1,118 @@ +--- +title: "Exercise 1 -- ML Basics" +subtitle: "[Introduction to Machine Learning](https://slds-lmu.github.io/i2ml/)" +--- + +::: {.content-hidden when-format="pdf"} +::: {.hidden} +{{< include ../_quarto/latex-math.qmd >}} +::: +::: + +## Exercise 1: HRO in coding frameworks + +Throughout the lecture, we will frequently use the `R` package +`mlr3`, resp. the `Python` package +`sklearn`, and its descendants, providing an integrated ecosystem for all +common machine learning tasks. +Let's recap the HRO principle and see how it is reflected in either `mlr3` or `sklearn`. +An overview of the most important objects and their usage, illustrated with +numerous examples, can be found at [the `mlr3` book](https://mlr3book.mlr-org.com/) and +[the `scikit` documentation](https://scikit-learn.org/stable/index.html). + +(@) How are the key concepts (i.e., hypothesis space, risk and optimization) + you learned about in the lecture videos implemented? + +::: {.content-visible when-profile="solution"} +
+**Solution** + +::: {.panel-tabset} +### R +{{< embed _r.ipynb#hro echo=true >}} + +### Python +{{< embed _python.ipynb#hro echo=true >}} +::: +
+::: + +(@) Have a look at`mlr3::tsk("iris")` / `sklearn.datasets.load_iris`. What attributes does this object store? + +::: {.content-visible when-profile="solution"} +
+**Solution** +::: {.panel-tabset} + +### R +{{< embed _r.ipynb#iris echo=true >}} + +### Python +{{< embed _python.ipynb#iris echo=true >}} +::: +
+::: + +(@) Instantiate a regression tree learner. What are the different settings for this learner? + * `R` Hint: use `lrn("regr.rpart")` (`mlr3::mlr_learners$keys()` shows all available learners). + * `Python` Hint: use the `DecisionTreeRegressor` module and use `get_params()` to see all available settings. + +::: {.content-visible when-profile="solution"} +
+**Solution** +::: {.panel-tabset} + +### R +{{< embed _r.ipynb#learner echo=true >}} + +### Python +{{< embed _python.ipynb#learner echo=true >}} +::: +
+::: + +## Exercise 2: Loss functions for regression tasks + +{{< include _ex_loss_functions.qmd >}} + +## Exercise 3: Polynomial regression + +{{< include _ex_polynomial.qmd >}} + +## Exercise 4: Predicting `abalone` + +{{< include _ex_abalone.qmd >}} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + +::: {.content-visible when-profile="solution"} +::: {.content-visible when-format="pdf"} +## Solution +Lorem ipsum dolor sit amet. +::: +::: {.content-visible when-format="html"} +
+ Solution + Lorem ipsum dolor sit amet. +
+::: +::: + +::: {.panel-tabset} +## R + +## Python +foo # bug: needs text between embeddings ([issue](https://github.com/quarto-dev/quarto-cli/issues/5255)) +::: + +::: {.content-visible when-profile="hf"} +::: {.content-visible when-format="pdf"} +# [Deep-dive for Major Statistics] Exercise 1$\ast$: Bar +$$(x - 3)^2 = 5 \in \Amat, \epsm$$ +::: +::: {.content-visible when-format="html"} +# Exercise 1$\ast$: Bar +$$(x - 3)^2 = 5 \in \Amat, \epsm$$ +::: +::: +