Processing math: 100%
+ - 0:00:00
Notes for current slide
Notes for next slide

Modelle

Maschinelles Lernen mit R
The R Bootcamp

Oktober 2020

1 / 16

There is no free lunch

"The no-free-lunch theorem of optimization is an impossibility theorem telling us that a general-purpose, universal optimization strategy is impossible. The only way one strategy can outperform another is if it is specialized to the structure of the specific problem under consideration."

Ho & Pepyne, 1997 Wolpert & Macready, 1997

2 / 16

Bias-Variance Dilemma


Error=Bias+Variance(+Noise)

  • Bias
    • Ensteht, wenn Modellannahmen nicht mit dem Problem übereinstimmen.

  • Variance
    • Ensteht, wenn Modellflexibilität zu hoch ist.

  • Noise
    • (Absolut) zufälliges Rauschen.


3 / 16

Linear oder Nicht-linear

  • Lineare Modelle
    • Machen die Annahme, dass die Welt linear ist. Stimmt selten, führt jedoch zu weniger overfitting.

  • Nicht-lineare Modelle
    • Beinhaltet (meist) lineare Modelle als Spezialfall und neigen damit zu mehr overfitting. Lohnt sich i.A. nur, wenn lineare Modelle das Problem schlecht approximieren.
5 / 16

Kernel Trick

  • Transformiert ursprünglichen Featurespace in einen neuen, der damit z.B. das Trennen von Klassen ermöglicht.

  • Verwendet z.B. in Support Vector Machines (z.B. method = "svmRadial") meist unter Verwendung einer radial basis function (rdf).


6 / 16

Automatische Featureentwicklung


  • Deep learning (insbesondere Convolutional Neural Networks) sind besonders gut darin, Features selber zu entwickeln.

  • Das tensorflow Paket bietet Zugang zu Google's mächtiger Tensorflow Library für Deep Learning.

7 / 16

Robustheit

  • Es gibt eine Reihe von Tricks um Modelle robuster zu machen, d.h. um den Variance Fehler zu minimieren.


from istockphoto.com

Approach Implementation Examples
Tolerance Vergrössert Fehlertoleranz svmRadial
Regularization Strafe für Komplexität lasso, ridge, elasticnet
Ensemble Bagging treebag, randomGLM, randomForest
Ensemble Boosting adaboost, xgbTree
Feature selection Regularization lasso
Feature selection Importance random forest
9 / 16

Regularization

  • Regularisierung bestraft den Fit für die modell-spezifische Komplexität.

Loss = Misfit + Penalty


Name Penalty caret
AIC/BIC -
Lasso method=glmnet
Ridge method=glmnet
Elastic Net method=glmnet

10 / 16

Bagging

  • Aggregieren der Vorhersagen multipler Modelle, die auf Basis von Stichproben aus den Daten gefitted werden.

  • Besonders nützlich bei Modellen mit moderat guter, varierender Performanz.

  • Algorithmus:
    1. Stichprobe aus den Daten mit zurücklegen
    2. Fitte Modelle zu Stichproben
    3. Mittele die Vorhersage
11 / 16

Boosting

  • Eine Art iteratives Bagging auf Basis einer adaptiven Gewichtung der Daten.

  • Variante Extreme Gradient Boosting xgbTree zählt zu den besten verfügbaren Modellen.

  • Algorithmus:
    1. Gewichte alle Datenpunkte gleich.
    2. Fitte ein moderat flexibles Modell.
    3. Erhöhe Gewicht schlecht vorhergesagter Punkte.
    4. Wiederhole iterativ.
    5. Mittele Vorhersage proportional zum Modellfit.
12 / 16

Automatische Featureselektion

  • LASSO

    • Schätzt oft beta = 0, was effektiv das Feature aus dem Modell eliminiert.


  • Decision Tree / Random forests

    • Features müssen nicht für die Vorhersage verwendet werden (bei hohem mtry).


from medium.com

13 / 16

Erinnere


"…some machine learning projects succeed and some fail. What makes the difference? Easily the most important factor is the features used."

Pedro Domingos


"The algorithms we used are very standard for Kagglers. […] We spent most of our efforts in feature engineering. [...] We were also very careful to discard features likely to expose us to the risk of over-fitting our model."

Xavier Conort


from open.edu

15 / 16

There is no free lunch

"The no-free-lunch theorem of optimization is an impossibility theorem telling us that a general-purpose, universal optimization strategy is impossible. The only way one strategy can outperform another is if it is specialized to the structure of the specific problem under consideration."

Ho & Pepyne, 1997 Wolpert & Macready, 1997

2 / 16
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow