TGViewer
Channel Public Channel
Data science/ML/AI

Data science/ML/AI

@datascience_bds

Data science and machine learning hub

Python, SQL, stats, ML, deep learning, projects, PDFs, roadmaps and AI resources.

For beginners, data scientists and ML engineers
๐Ÿ‘‰ https://rebrand.ly/bigdatachannels

DMCA: @disclosure_bds
Contact: @mldatascientist
Subscribers
14.1K
Photos
610
Videos
7
Links
341

Showing posts older than #1163 ยท Back to latest

Older Posts 20 shown
Post #1162 2.34K
๐Ÿงช Data Leakage Through Preprocessing

Your model is cheatingโ€ฆ and you donโ€™t even see it.

๐Ÿง  Whatโ€™s actually happening

You already know leakage from obvious features.
But the dangerous version happens during preprocessing.

Example mistake:

You scale your entire dataset before splitting.
from sklearn.preprocessing import StandardScaler

scaler = StandardScaler()
X_scaled = scaler.fit_transform(X) # โŒ WRONG

Why is this wrong?

Because the scaler learns:

๐Ÿ“Š mean
๐Ÿ“‰ standard deviation

โ€ฆfrom the entire dataset, including test data.

๐ŸŽฏ Why this breaks everything

Your model now has indirect knowledge of the test set distribution.

Even though you didnโ€™t touch labels, you leaked statistical information.

This leads to:

๐Ÿ“ˆ overly optimistic accuracy
โŒ poor real-world performance

โœ… The Correct Way

Always split first:
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler

X_train, X_test, y_train, y_test = train_test_split(X, y)

scaler = StandardScaler()
X_train = scaler.fit_transform(X_train)
X_test = scaler.transform(X_test) # โœ… only transform


๐Ÿ”‘ Any operation that โ€œlearns from dataโ€ must only see training data.
  • โค 9
Post #1161 1.98K
๐Ÿ“ˆCorrelation vs. Causality ๐Ÿ”

This is the #1 rule in data science. Just because two variables move together in a chart doesn't mean one is actually causing the other to happen.

๐Ÿ‘‰ Mistaking correlation for causality leads to "fake" insights and bad business decisions.

๐Ÿ”น 1. What is Correlation?
Correlation is a statistical measure that describes the size and direction of a relationship between two variables.
โ€ข Positive: Both go up together (e.g., Temperature and Ice Cream sales).
โ€ข Negative: One goes up, the other goes down (e.g., Price and Demand).

๐Ÿ”น 2. What is Causality?
Causality (Cause and Effect) means that one variable directly triggers a change in the other. If you change "A," then "B" must change because of it.

๐Ÿ”น 3. The "Spurious" Trap
Sometimes two things are correlated purely by chance or because of a Third Variable (a Confounder).
โ€ข Classic Example: Shark attacks and Ice Cream sales are highly correlated.
โ€ข The Trap: Does eating ice cream cause shark attacks? No.
โ€ข The Reality: The "Hidden Variable" is Summer. Hot weather causes people to swim more and buy more ice cream.

๐Ÿ”น 4. How to Prove Causality?
In data science, we don't just look at a scatter plot to prove cause. We use:
โ€ข A/B Testing (Randomized Controlled Trials): The gold standard.
โ€ข Natural Experiments: Looking at sudden policy changes.
โ€ข Domain Expertise: Understanding the logic behind the data.

๐Ÿ”น 5. Why it matters in Data Viz
When you visualize data, be careful with your captions. Avoid saying "Increasing X caused Y to drop" unless you have performed a controlled experiment. Stick to "X and Y show a strong negative relationship."

๐Ÿ‘‰ Correlation is a hint; Causality is a fact. Don't let a pretty chart trick you into a false conclusion!
  • โค 8
  • ๐Ÿ”ฅ 2
Post #1159 2.13K
Big Data Glossary
  • โค 5
Post #1157 2.22K
โšก๏ธ Backpropagation

Backpropagation is the algorithm that tells a neural network how to adjust its weights after making a mistake.

It pushes the error backward through the network.

Core idea: Measure error โ†’ send blame backward โ†’ update weights.

It's purpose is to minimize prediction error efficiently.

Where it is used:

๐Ÿง  Training neural networks
๐Ÿ‘ Computer vision
๐Ÿ—ฃ NLP models
๐Ÿ”Š Speech systems
๐Ÿค– Deep learning

Simple flow:
1๏ธโƒฃ Forward pass makes prediction
2๏ธโƒฃ Loss measures error
3๏ธโƒฃ Backward pass computes gradients
4๏ธโƒฃ Optimizer updates weights

Things to know:

๐Ÿ“‰ Needs differentiable functions
โšก๏ธ Uses chain rule from calculus
๐Ÿงฎ Works with gradient descent
๐Ÿšจ Can suffer from vanishing gradients

โœ…Backprop = error feedback system for neural networks.
  • โค 7
  • ๐Ÿ‘ 1
Post #1154 2.15K
โšก๏ธ ETL

ETL stands for Extract, Transform, Load.
It is the pipeline that moves and cleans data for analytics.

Core idea: Collect โ†’ clean โ†’ store.

Where it is used:

๐Ÿข Data warehouses
๐Ÿ“Š Business intelligence
๐Ÿง  ML feature pipelines
โ˜๏ธ Cloud data platforms
๐Ÿ“ˆ Reporting systems

It's purpose is to make data reliable and analysis ready.

Simple flow:
1๏ธโƒฃ Extract from sources
2๏ธโƒฃ Transform into clean format
3๏ธโƒฃ Load into destination system

Things to know:

๐Ÿ” Modern systems often use ELT
โฑ๏ธ Can be batch or streaming
๐Ÿงน Data quality checks are critical
๐Ÿ“ฆ Scalability matters at scale

โœ…ETL = factory assembly line for data.
  • โค 5
  • ๐Ÿ‘ 3
Post #1152 2.04K
Excel vs Power BI
  • โค 8
  • ๐Ÿ‘ 1
Post #1150 2.26K
โšก๏ธ A/B Testing

A/B testing is a controlled experiment where you compare two versions to see which performs better.

At its core: change one thing โ†’ measure the impact.

Core idea:
Same users, different variants, measurable outcome.

Where it is used:

๐Ÿ“Š Product feature launches
๐Ÿ›’ Conversion optimization
๐Ÿ“ง Email marketing
๐ŸŒ UI/UX decisions
๐Ÿ“ฑ Growth experiments

It's purpose is to make decisions based on real user behavior instead of opinions.

Simple flow:
1๏ธโƒฃ Split users randomly
2๏ธโƒฃ Show version A and B
3๏ธโƒฃ Measure key metric
4๏ธโƒฃ Pick the winner

Things to know:

๐ŸŽฏ Needs enough sample size
โš–๏ธ Randomization is critical
โณ Stop only after statistical significance
๐Ÿšซ Testing too many changes at once breaks results

โœ… A/B testing = scientific method for product decisions.
  • โค 5
Post #1147 2.36K
๐Ÿ“Š Data Science Essentials: What Every Data Enthusiast Should Know!

1๏ธโƒฃ Understand Your Data
Always start with data exploration. Check for missing values, outliers, and overall distribution to avoid misleading insights.

2๏ธโƒฃ Data Cleaning Matters
Noisy data leads to inaccurate predictions. Standardize formats, remove duplicates, and handle missing data effectively.

3๏ธโƒฃ Use Descriptive & Inferential Statistics
Mean, median, mode, variance, standard deviation, correlation, hypothesis testing these form the backbone of data interpretation.

4๏ธโƒฃ Master Data Visualization
Bar charts, histograms, scatter plots, and heatmaps make insights more accessible and actionable.

5๏ธโƒฃ Learn SQL for Efficient Data Extraction
Write optimized queries (SELECT, JOIN, GROUP BY, WHERE) to retrieve relevant data from databases.

6๏ธโƒฃ Build Strong Programming Skills
Python (Pandas, NumPy, Scikit-learn) and R are essential for data manipulation and analysis.

7๏ธโƒฃ Understand Machine Learning Basics
Know key algorithms like; linear regression, decision trees, random forests, and clustering to develop predictive models.

8๏ธโƒฃ Learn Dashboarding & Storytelling
Power BI and Tableau help convert raw data into actionable insights for stakeholders.
  • โค 5
Post #1145 2.2K
๐Ÿง  Label Smoothing

Label smoothing exists to fix one quiet problem:

Neural networks become overconfident.

In standard classification, targets are one-hot:
correct class โ†’ 1
others โ†’ 0

This tells the model:
Be absolutely certain.


๐Ÿ” What Label Smoothing Does

Instead of hard targets, we soften them.

Example (3 classes, smoothing = 0.1):

correct class โ†’ 0.9
others โ†’ 0.05

The model is no longer pushed toward extreme certainty.

๐ŸŽฏ Why It Works

One-hot targets force logits to grow very large to minimize cross-entropy.
This leads to:

๐Ÿ“ˆ Overconfidence
โš ๏ธ Poor calibration
๐Ÿง  Brittle generalization

Label smoothing acts as regularization in probability space.

It tells the model:
Be confident, but not blindly certain.


๐Ÿ— Where Itโ€™s Used

๐Ÿค– Image classification (ResNets, EfficientNet)
๐Ÿ“ Transformers and language models
๐Ÿ† Large-scale training pipelines


โš ๏ธ Key Things to Know
๐Ÿšซ Too much smoothing hurts accuracy
โš–๏ธ Typical values: 0.05 to 0.1
๐Ÿงช Helps generalization more than training loss
๐Ÿ“‰ Often improves calibration

โœ… In short:

Label smoothing prevents the model from collapsing into extreme certainty.

It trades a tiny bit of training confidence for better real-world behavior.
  • โค 5
Older posts โ†’
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’