FearMerchant retweeted
Replying to @ArmandDoma
You guys are kinda east west versions of each other tho
FearMerchant retweeted
The Bias Vs Variance tradeoff clearly explained!
A good, or rather, a useful machine learning model is all about striking the right balance between bias (underfitting) and variance (overfitting).
Today, I'll clearly explain bias, variance, and how to strike a balance between the two.
Imagine you're learning archery. 🏹
Your goal is to hit the bullseye as closely as possible. Here's how the archery metaphor ties into bias and variance:
(refer the image below as you read)
🔹Bias:
Shooting arrows consistently to the left of the target. You're missing the mark, but doing so consistently. This is underfitting.
🔸Variance:
Arrows are spread all over the target. You're inconsistent but average out to hitting the bullseye. This is overfitting.
In machine learning, bias refers to the error due to overly simplistic assumptions in the learning algorithm.
High bias can cause the model to miss relevant patterns, leading to underperformance (underfitting).
On the other hand, variance is the error due to too much complexity in the learning algorithm.
High variance can cause the model to model the random noise in the training data, leading to poor performance on new data (overfitting).
Now, let's understand things mathematically❗️
🔹Bias:
Bias of an ML model is the average of difference between model's predicted values & actual values over all possible data sets.
Bias is a systematic error, it would not change even if you change the dataset (which is a sampled from a particular distribution) as long as the underlying distribution remains same.
Formula:
Bias(ŷ) = E(ŷ) - y
where E(ŷ) is the expected value (or average of all values) of the model predictions, and y is the true value.
🔸Variance:
Variance refers to the extent to which a model's predictions will vary when trained on different datasets. A high variance model tends to overfit the specific training data and fails to grasp the underlying distribution of the data.
Formula:
Var(Y_pred) = Σ [(Y_pred[i] - Y_mean)²] / n
Y_pred as the predicted values from your machine learning model,
Y_mean as the mean of these predictions.
These two components contribute to the Total Error in a model, defined as:
Total Error = Bias^2 + Variance + Irreducible Error
Here, "Irreducible Error" is the noise term that cannot be reduced regardless of what algorithm is used.
It's the inherent uncertainty in any real-world data.
Striking the Balance:
Our goal is to find the sweet spot between bias and variance.
In our archery example, we want arrows that cluster closely around the bullseye—neither too far off to one side (high bias) nor too spread out (high variance).
Techniques to strike this balance:
1. Cross-Validation: Split your data into training and validation sets to measure how well your model generalizes.
2. Regularization: Introduce a penalty term to discourage overly complex models.
3. Ensemble Methods: Combine multiple models to average out their biases and variances.
Conclusion:
Remember, you're not looking for a perfect model; you're looking for a useful one.
Finding the right balance between bias and variance will help you achieve just that. 🎯
________________
If you Enjoyed reading this & are interested in
- Python 🐍
- ML/MLOps 🛠
- CV/NLP 🗣
- LLMs 🧠
- AI Engineering ⚙️
Find me → @akshay_pachaar ✔️
Every week, I also do a deep dive on one of these topics in My Newsletter MLSpring!
Join (2.5K+ readers), link in the next tweet!
________________
Thanks for reading! 🙏
But it’s scary.
The amount of steel that goes into the foundations of a nuclear power plant is next level. 🔊
It is expensive to build, but consider what you get in return. A source of energy that produces hundreds (or thousands) of megawatts of electricity up to 70-80 years or so. It does not directly pollute or contaminate the air.
The 70-80 year remark is based on OL1 & OL2 nuclear reactors in Finland. Commercial production started in 1978 and the current permit allows the plants to operate until year 2050.
If you don't build the nuclear power plants, then you have to build lots of coal, natural gas or other baseload forms of energy. Nuclear is by far the best option.
2
644
FearMerchant retweeted
The amount of steel that goes into the foundations of a nuclear power plant is next level. 🔊
It is expensive to build, but consider what you get in return. A source of energy that produces hundreds (or thousands) of megawatts of electricity up to 70-80 years or so. It does not directly pollute or contaminate the air.
The 70-80 year remark is based on OL1 & OL2 nuclear reactors in Finland. Commercial production started in 1978 and the current permit allows the plants to operate until year 2050.
If you don't build the nuclear power plants, then you have to build lots of coal, natural gas or other baseload forms of energy. Nuclear is by far the best option.
FearMerchant retweeted
Neil Gaiman writes the first draft of every book by hand.
His reasoning is fascinating:
With a computer you “write that down and look at it and then fiddle with it.”
With a pen you “slow up a bit, but you’re thinking the sentence through to the end, and then you start writing.”
Computers let your writing balloon.
Your story loses its shape and focus.
But writing with a pen forces you to consider every word, every sentence, before writing.
Your story stays sharp.
My takeaway — Your medium affects your output.
Writing on twitter → punchy with little nuance, constant feedback.
Writing a newsletter → longer form, more nuance but less feedback.
Writing a book → long form, lots of nuance but no feedback for a long time.
Neil noticed the same comparing computers and notebooks.
His other suggestions:
Leuchtturm notebooks over Moleskines. Visconti fountain pens.
This is a handwritten page from his novel Coraline:
FearMerchant retweeted
9 years ago, Peter Thiel hosted an AMA on Reddit.
It's full of gems on AI, technology and startups.
Here are my favourites:
FearMerchant retweeted
I gave GPT-4 a budget of $100 and told it to make as much money as possible.
I'm acting as its human liaison, buying anything it says to.
Do you think it will make smart investments and build an online business?
Follow along 👀
(Day 3)
Heading to NYC at the end of the week. Gonna need to follow this one.
This quoted post is unavailable.
1
161
FearMerchant retweeted
Best YouTube channels for Data Science:
❯ Mathematics ➟ 3Blue1Brown
❯ Python ➟ Corey Schafer
❯ SQL ➟ Joey Blue
❯ MS Excel ➟ ExcelIsFun
❯ Tableau ➟ Tableau Tim
❯ PowerBI ➟ Guy in a Cube
❯ Machine Learning ➟ sentdex
❯ Special ➟ Leila Gharani
FearMerchant retweeted
A complete set of volatility estimators based on Euan Sinclair's Volatility Trading
• Parkinson
• Yang Zhang
• Garman Klass
• Rogers Satchell
• Hodges Tompkins
• Standard Deviation
Get the code here:
FearMerchant retweeted
Self-diagnosed mental health impairments spread virally on social media (originally Tumblr now Twitter) and become “real” through a kind of reverse-CBT.
sciencedirect.com/science/ar… – at Washington, DC
FearMerchant retweeted
Looks like the first open source equivalent of ChatGPT has arrived: github.com/lucidrains/PaLM-r…
I.e., an implementation of RLHF (Reinforcement Learning with Human Feedback) on top of Google’s 540 billion parameter PaLM architecture
FearMerchant retweeted
Unless you've built a machine learning system before, you'd think it's just like building regular software.
It's not.
Here is a reason they are different and what you can do about it:
1 of 13
FearMerchant retweeted
If you're closer than your opponent to executing optimal strategy, you're a favorite, right?
WRONG
Here is a simple breakdown of why that is and what it means for you. 🧵
FearMerchant retweeted
Here's a question you know the answer to:
"How does a Python `for` loop work?"
"What a silly question", I can hear you think. But, do you _really_ know what's happening behind the scenes?
Let's have a look at iterables, iterators, and the `for` loop…
/1
























