5 ms·
Why do random forests work? They are self-regularizing adaptive smoothers
- PoignardAzur 2y agoReading the abstract alone, I have no idea whether it's talking about algorithmic trees or, like, the big brown things with small green bits.
- vatys 2y agoI had the exact same reaction: biology or computers? The only hint I can see anywhere on the page is "Statistics > Machine Learning" above the abstract title. I really want it to be about actual biological trees being studied on the scale of forests growing with smooth edges over long periods of time, but I suspect that's not what it is about.
- bonoboTP 2y agoThere's also "Subjects: Machine Learning (stat.ML); Machine Learning (cs.LG)" Also, the very first sentence of the actual paper (after the abstract) is > Random forests (Breiman, 2001) have emerged as one of the most reliable off-the-shelf supervised learning algorithms [...] arxiv.org is overwhelmingly used for math and computer science papers, though not exclusively. The paper will also likely be submitted to a machine learning venue.
- ibgeek 2y agoBiological trees don’t make predictions. Second or third sentence contains the phrase “randomized tree ensembles not only make predictions.”
- visarga 2y agoEven single cells are able to sense and adapt to their environment. That is to recognize and react.
- mhuffman 2y agoIt's talking about these[0] [0]https://en.wikipedia.org/wiki/Random_forest https://en.wikipedia.org/wiki/Random_forest
- defjm 2y agoJeremy Howard has a great video explaining Random Forests: https://youtu.be/blyXCk4sgEg https://youtu.be/blyXCk4sgEg .
- krystofee 2y agoYou have to know some machine learning fundamentals to figure that out - “Random Forest” is a specific machine learning algorithm, which does not need a further explanation. To take it a step further, they should really not describe “Machine learning”, no, its not like the machine takes a book and learns, its a term.
- bigmadshoe 2y agoThe tree is an incredibly common data structure in computer science. Decision trees are well known. Random forests are ubiquitous in Machine Learning. Should the authors really have to dumb their paper down so people who don’t work in this domain avoid confusing it with work in arborism?
- youoy 2y agoNice article, although I find it's a bit overly complex if your are not familiar with ML and mathematics at the same time. I will leave here a geometrical intuition of why they work in case it can help someone: To simplify things, I will talk about regression, and say we want to predict some value y, that we know depends on x, and we have some noisy measurements of y. y = f(x) y_observed = f(x) + noise If you want some mental image, think about f(x)=sin(x). Now, a (over fitted) regression tree in this case is just a step function where the value at x is y_observed. If there is no noise, we now that by doing more measurements, we can approximate y with as much precision as we want. But if there is noise, the regression tree will over fit the noisy values, creating some artificial spikes. If you want to avoid this over fitting, you sample a lot of times the values of X, and for each sample you build a regression tree, and then average them. When you average them, every tree will contain its own particular artificial spikes, and if they are noise, they won't appear in the majority of the other trees. So when you average them, the spikes will attenuate, creating the smoother behaviour that the article talks about. I hope it helps!
- hammock 2y agoThanks that helps. The way I think about your example is it’s like (not the same obv) taking a bunch of moving averages of different durations at different starting points, and throwing those into your regression model along with the actual data
- dbetteridge 2y agoSome overlay lots of really squiggly lines, average (most points in common) is the actual function you're looking for?
- math_dandy 2y agoThis is good intuition for why ensembling overparametrized is a good idea. Doesn’t speak to why ensembles of tree-structured estimators in particular perform so well compared to ensembles of other nonparametric estimators.
- youoy 2y ago
- levocardia 2y agoGood to see more research exploring the connection between trees, ensembles, and smoothing. Way back in Trevor Hastie's ESL book there's a section on how gradient boosting using "stumps" (trees with only one split) is equivalent to an additive spline model (GAM, technically) with a step function as a spline basis and adaptive knot placement. I've always thought there should be a deep connection between ReLU neural nets and regularized adaptive smoothers as well, since the ReLU function is itself a spline basis (a so-called truncated linear spline) and happens to span the same functional basis as B-splines of the same degree.
- almostgotcaught 2y agoOne of my biggest pet peeves is flagrant overuse of "deep". Everything is so deep around around here these days... > since the ReLU function is itself a spline basis (a so-called truncated linear spline) and happens to span the same functional basis as B-splines of the same degree. ... you literally just spelled out the entire "depth" of it.
- abhgh 2y agoI don't know if you have come across this: A Spline Theory of Deep Networks [1]. Has been on my To-Read list forever :( [1] http://proceedings.mlr.press/v80/balestriero18b/balestriero18b.pdf http://proceedings.mlr.press/v80/balestriero18b/balestriero1...
- tylerneylon 2y agoHere's some context and a partial summary (youoy also has a nice summary) -- Context: A random forest is an ML model that can be trained to predict an output value based on a list of input features: eg, predicting a house's value based on square footage, location, etc. This paper focuses on regression models, meaning the output value is a real number (or a vector thereof). Classical ML theory suggests that models with many learned parameters are more likely to overfit the training data, meaning that when you predict an output for a test (non-training) input, the predicted value is less likely to be correct because the model is not generalizing well (it does well on training data, but not on test data - aka, it has memorized, but not understood). Historically, a surprise is that random forests can have many parameters yet don't overfit. This paper explores the surprise. What the paper says: The perspective of the paper is to see random forests (and related models) as _smoothers_, which is a kind of model that essentially memorizes the training data and then makes predictions by combining training output values that are relevant to the prediction-time (new) input values. For example, k-nearest neighbors is a simple kind of smoother. A single decision tree counts as a smoother because each final/leaf node in the tree predicts a value based on combining training outputs that could possibly reach that node. The same can be said for forests. So the authors see a random forest as a way to use a subset of training data and a subset of (or set of weights on) training features, to provide an averaged output. While a single decision tree can overfit (become "spikey") because some leaf nodes can be based on single training examples, a forest gives a smoother prediction function since it is averaging across many trees, and often other trees won't be spikey for the same input (their leaf node may be based on many training points, not a single one). Finally, the authors refer to random forests as _adaptive smoothers_ to point out that random forests become even better at smoothing in locations in the input space that either have high variation (intuitively, that have a higher slope), or that are far from the training data. The word "adaptive" indicates that the predicted function changes behavior based on the nature of the data — eg, with k-NN, an adaptive version might increase the value of k at some places in the input space. The way random forests act adaptively is that (a) the prediction function is naturally more dense (can change value more quickly) in areas of high variability because those locations will have more leaf nodes, and (b) the prediction function is typically a combination of a wider variety of possible values when the input is far from the training data because in that case the trees are likely to provide a variety of output values. These are both ways to avoid overfitting to training data and to generalize better to new inputs. Disclaimer: I did not carefully read the paper; this is my quick understanding.
- bonoboTP 2y agoThe same team wrote another interesting paper arguing that there's no "double descent" in linear regression, trees, and boosting, despite what many argued before (in this paper they don't tackle deep learning double descent, but remark that the case may be similar regarding the existence of different complexity measures being conflated).
- selimthegrim 2y agohttps://arxiv.org/abs/2310.18988 https://arxiv.org/abs/2310.18988
- StableAlkyne 2y agoRandom forests are incredible cool algorithms. The idea that you can take hundreds of bad models that over fit (the individual decision trees), add even more randomness by randomly picking training data and features*, and averaging them together - it's frankly amazing that this leads to consistently OK models. Often not the best but rarely the worst. There's a reason they're such a common baseline to compare against. *Unless you're using Sklearn, whose implementation of RandomForestRegressor is not a random forest. It's actually bagged trees because they don't randomly select features. Why they kept the misleading classname is beyond me.
- jncfhnb 2y agoWith a relatively small variant to make it gradient boosted trees it’s pretty much as good as it gets for tabular data these days
- hanslovsky 2y agoTIL sklearn doesn't actually implement random forest. Goos to know, thank you!
- StableAlkyne 2y agoIt does implement one, just the default settings do not
- alexfromapex 2y agoQuantized random sampling regression
- foundry27 2y agoI like this article. Randomness in system design is one of the most practical ways to handle the messiness of real world inputs, and I think random forests nail this by using randomness to produce useful outputs to various inputs without overfitting and adapt to the unexpected. Yeah, you can always engineer a system that explicitly handles every possible situation, but the important question is “how long/costly will that process be?”. Deterministic systems aren’t good on that front, and when edge cases hit, sometimes those rigid models crack. Controlled randomness (load balancing, feature selection, etc.) makes systems more flexible and resilient. You don’t get stuck in the same predictable ruts, and that’s exactly why randomness works where pure determinism fails
- SomaticPirate 2y agoAny suggestions for a 101 introduction to random forests? In university I encountered some ML courses but never random forests.
- jph00 2y agoYeah I did a deep dive on them here -- doesn't require any particular math background beyond high school: https://www.youtube.com/watch?v=blyXCk4sgEg https://www.youtube.com/watch?v=blyXCk4sgEg
- sunshinesnacks 2y agoStatquest is really good. Maybe a little basic if you’ve taken ML courses, though? https://youtube.com/playlist?list=PLblh5JKOoLUIE96dI3U7oxHaCAbZgfhHk&si=mjR1sGi97wVQDR-I https://youtube.com/playlist?list=PLblh5JKOoLUIE96dI3U7oxHaC...
- RandomThoughts3 2y agoGrab any ML book and read the chapter on random forests. If you have the maths background (which is not particularly high for random forests) which you should if you took ML courses, it’s all going to be pretty straightforward. I think someone already mentioned Hastie, The Elements of Statistical Learning, in this thread which you can download for free and would be a good start.
- __mharrison__ 2y agoMy book, Effective XGBoost, covers tree theory from stumps to decision trees, to bagging (random forests) to boosting.
- xiaodai 2y agoXGBoost LightGBM Catboost and JLBoost?
- Iwan-Zotow 2y agoCool, more random ess at work
- oli5679 2y agoMy understanding of why bagging works well is because it’s a variance reduction technique. If you have a particular algorithm, the bias will not increase if you train n versions in ensemble, but the variance will decrease as more anomalous observations won’t persistently be identified in submodel random samples and so won’t the persist in the bagging process. You can test this. The difference between train and test auc will not increase dramatically as you increase number of trees in sklearn random forest for same data and hyperparameters.
- Dropbysometime 2y agoWhy do Random Forests Work? Understanding Tree Ensembles as Self-Regularizing Adaptive Smoothers https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0286362 https://journals.plos.org/plosone/article?id=10.1371/journal... Found the GitHub repository code https://github.com/AzazHassankhan/Machine-Learning-based-Trading-Techniques/blob/main/Machine_Learning_based_Backtester.ipynb https://github.com/AzazHassankhan/Machine-Learning-based-Tra... Made some changes from line 9 to 70 . Usee yfinance instead of alpaca Replace all code with code below until line# 70 import plotly.offline as pox import plotly.graph_objs as go import numpy as np import talib as tl import matplotlib.pyplot as plt import pandas as pd import numpy as np import talib as ta from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score,classification_report #import alpaca_trade_api as tradeapi #from alpaca_trade_api import TimeFrame, TimeFrameUnit from sklearn.ensemble import RandomForestClassifier from sklearn.preprocessing import StandardScaler import seaborn as sns from matplotlib.pyplot import figure from statsmodels.tsa.stattools import adfuller from sklearn.svm import SVC from sklearn.neighbors import KNeighborsClassifier from sklearn.linear_model import LogisticRegression from sklearn.ensemble import AdaBoostClassifier import yfinance as yf from datetime import datetime symb = "TSLA" start = datetime(2021, 10, 18, 9, 30, 0) end = datetime(2021, 10, 18, 10, 30, 0) df =yf.download("TSLA", period="1mo",interval ="15m") next=df.copy() next.tail() df['close']=df['Close'] df['high']=df['High'] df['low']=df['Low'] df['open']=df['Open'] df['volume']=df['Volume']