Predictive modeling is fun. With random forest, xgboost, lightgbm and other elastic models…
Problems start when someone is asking how predictions are calculated.
Well, some black boxes are hard to explain.
And this is why we need good explainers.
In the June Aleksandra Paluszynska defended her master thesis Structure mining and knowledge extraction from random forest. Find the corresponding package randomForestExplainer and its vignette here.
In the September David Foster published a very interesting package xgboostExplainer. Try it to extract useful information from a xgboost model and create waterfall plots that explain variable contributions in predictions. Read more about this package here.
In the October Albert Cheng published lightgbmExplainer. Package with waterfall plots implemented for lightGBM models. Its usage is very similar to the xgboostExplainer package.
Waterfall plots that explain single predictions are great. They are useful also for linear models. So if you are working with lm() or glm() try the brand new breakDown package (hmm, maybe it should be named glmExplainer). It creates graphical explanations for predictions and has such a nice cheatsheet:
Install the package from https://pbiecek.github.io/breakDown/.
Thanks to RStudio for the cheatsheet’s template.
Jak takie wykresy wyglądaj gdy model ma >100 zmiennych? Pomnijeszana jest czcionka? Warto zwiększyć rozmiar wykresu? Może pokazać magiczne 'top N’ zmiennych wtedy względem jakiejś miary (dopasowana p-wartość brzmi Ok)?
Magiczne top N to dobry pomysł, wrzuć issue na githuba. Co do p-wartości to testowanie hipotez jest passé 😉
A można prosić o jakiś dobry link na ten temat? Może temat po prostu nie jest prosty, ale czytam o tym już któryś raz i wciąż nie rozumiem dlaczego p-values są złe.
Nie napisałem, że p-wartości są złe, tylko że są passe = niemodne.
A są niemodne, bo szarlatani analizy danych tłuką je na oślep bez zrozumienia.
Pisze o tym np ASA https://www.amstat.org/asa/files/pdfs/P-ValueStatement.pdf
Moim zdaniem p-wartości są bardzo dobre. Tylko niewiele osób rozumie co to jest i dlatego niewiele osób powinno mieć prawo do ich używania 😉
Jaka musi być minimalna ilość danych, żeby taka predykcja miała sens?
W przypadku modeli regresyjnych można wyznaczyć przedział ufności dla predykcji, trochę mówi on o wiarogodności predykcji. W różnych zastosowaniach 'miała sens’ może znaczyć zupełnie różne poziomy wiarogodności.
W zastosowaniu prognozowania odejścia pracownika z pracy z przykładu Davida Fostera. Ilość pracowników w bazie/ilość pracowników jaka odeszła.