Data Science & Machine Learning
Join this channel to learn data science, artificial intelligence and machine learning with funny quizzes, interesting projects and amazing resources for free For collaborations: @love_data
إظهار المزيد📈 نظرة تحليلية على قناة تيليجرام Data Science & Machine Learning
تُعد قناة Data Science & Machine Learning (@datasciencefun) في القطاع اللغوي الإنكليزية لاعباً نشطاً. يضم المجتمع حالياً 77 736 مشتركاً، محتلاً المرتبة 2 009 في فئة التعليم والمرتبة 3 920 في منطقة الهند.
📊 مؤشرات الجمهور والحراك
منذ تأسيسه في невідомо، حقق المشروع نمواً سريعاً وجمع 77 736 مشتركاً.
بحسب آخر البيانات بتاريخ 27 أكتوبر, 2026، تحافظ القناة على نشاط مستقر. خلال آخر 30 يوماً تغيّر عدد الأعضاء بمقدار 160، وفي آخر 24 ساعة بمقدار -12، مع بقاء الوصول العام مرتفعاً.
- حالة التحقق: غير موثّقة
- معدل التفاعل (ER): يبلغ متوسط تفاعل الجمهور 2.79%. وخلال أول 24 ساعة من النشر يحصد المحتوى عادةً 1.13% من ردود الفعل نسبةً إلى إجمالي المشتركين.
- وصول المنشورات: يحصل كل منشور على متوسط 2 171 مشاهدة. وخلال اليوم الأول يجمع عادةً 879 مشاهدة.
- التفاعلات والاستجابة: يتفاعل الجمهور بانتظام؛ متوسط التفاعلات لكل منشور يبلغ 3.
- الاهتمامات الموضوعية: يركز المحتوى على مواضيع رئيسية مثل learning, accuracy, distribution, panda, dataset.
📝 الوصف وسياسة المحتوى
يصف المؤلف القناة بأنها مساحة للتعبير عن الآراء الذاتية:
“Join this channel to learn data science, artificial intelligence and machine learning with funny quizzes, interesting projects and amazing resources for free
For collaborations: @love_data”
بفضل وتيرة التحديث المرتفعة (أحدث البيانات بتاريخ 28 أكتوبر, 2026) تحافظ القناة على حداثتها ومستوى وصول مرتفع. وتُظهر التحليلات تفاعلاً نشطاً من الجمهور، ما يجعلها نقطة تأثير مهمة ضمن فئة التعليم.
order_id | customer_id | product | price
1 | 101 | Laptop | 60000
2 | 102 | Phone | 30000
3 | 101 | Mouse | 1000
To retrieve order details:
SELECT
order_id,
customer_id,
product,
price
FROM orders;
To calculate price after adding a hypothetical 10% increase:
SELECT
product,
price,
price * 1.10 AS increased_price
FROM orders;
🔹 21. SELECT in Real-World Data Science
SQL is often the first step in a Data Science workflow.
For example:
Business Question
"Give me all customer transactions from the sales database."
You might start with:
SELECT
customer_id,
order_date,
product_id,
amount
FROM transactions;
Then later:
WHERE → Filter data
GROUP BY → Aggregate data
JOIN → Combine tables
ORDER BY → Sort results
Window Functions → Advanced analysis
Eventually, you may load the SQL result into Pandas:
import pandas as pd
df = pd.read_sql(query, connection)
So SQL and Python often work together.
🔹 22. Common Beginner Mistakes
❌ Mistake 1: Forgetting the FROM clause
Incorrect:
SELECT name;
when you intend to retrieve a column from a table.
Correct:
SELECT name
FROM customers;
❌ Mistake 2: Using commas incorrectly
Correct:
SELECT name, city, age
FROM customers;
❌ Mistake 3: Confusing column names and values
A column:
city
is different from a text value:
'Pune'
We'll explore this more when we learn WHERE.
❌ Mistake 4: Using SELECT * everywhere
SELECT * is useful while learning and exploring, but for production queries, selecting only the required columns can be more efficient and clearer.
🔹 23. Interview Questions
💡 What does SELECT do?
SELECT specifies the columns or expressions that should appear in the query result.
💡 What does SELECT * mean?
It selects all columns from the specified table.
💡 What is an alias?
An alias gives a temporary name to a column or expression in the query result.
💡 What does DISTINCT do?
It removes duplicate rows from the selected result.
🎯 Practice Questions
Q1. Write a query to select all columns from a table called employees.
Q2. Write a query to select only employee_id and salary from employees.
Q3. Write a query to display salary as monthly_salary.
Q4. Write a query to calculate price * quantity as total_amount from an orders table.
Q5. Write a query to return unique values from the department column of an employees table.
🎯 Key Takeaways
✅ SQL is used to communicate with relational databases.
✅ SELECT specifies what you want to retrieve.
✅ FROM specifies the table.
✅ * means all columns.
✅ You can select one or multiple columns.
✅ AS creates a temporary alias.
✅ SQL can perform calculations.
✅ DISTINCT returns unique results.
✅ SQL is one of the most important tools for extracting data before analysis and Machine Learning.
🧭 Double Tap ❤️ For More
-----
1.57 ₽ · /balance_helpSELECT name
FROM customers;
Here:
SELECT → What to retrieve
FROM → Where to retrieve it from
🔹 12. SQL Case Sensitivity
SQL keywords are commonly written in uppercase:
SELECT
FROM
WHERE
This improves readability.
For example:
SELECT customer_id, name
FROM customers;
is easier to read than:
select customer_id,name from customers;
Most SQL database systems treat keywords as case-insensitive, although behavior regarding identifiers such as table and column names can vary by database system and configuration.
Recommended style:
Use:
UPPERCASE for SQL keywords
lowercase or snake_case for column/table names
🔹 13. Column Aliases
You can temporarily give a column a different name using AS.
Example:
SELECT
name AS customer_name
FROM customers;
The result will display:
customer_name
Alice
Bob
Carol
The original column name in the database is not changed.
The alias only changes how the result is displayed.
🔹 14. Aliases Without AS
In many SQL systems, you can also write:
SELECT
name customer_name
FROM customers;
However, using AS is generally clearer:
SELECT
name AS customer_name
FROM customers;
🔹 15. Calculations in SELECT
SQL can perform calculations.
Suppose we have:
price
quantity
We can calculate total sales:
SELECT
price,
quantity,
price * quantity AS total_amount
FROM orders;
This creates a calculated column:
total_amount = price × quantity
This ability becomes extremely useful in Data Analytics.
🔹 16. Using SELECT with Expressions
You can perform various calculations.
Example:
SELECT
salary,
salary * 12 AS annual_salary
FROM employees;
If monthly salary is:
₹50,000
then:
annual_salary = ₹600,000
The original database isn't modified.
The calculation is performed when the query runs.
🔹 17. Selecting Constants
SQL can also return constant values.
Example:
SELECT
'Data Science' AS course;
Result:
course
Data Science
You can also use numbers:
SELECT
2026 AS year;
Result:
year
2026
This becomes useful when constructing analytical datasets.
🔹 18. DISTINCT
DISTINCT is part of the roadmap and we'll study it properly later.
For now, understand its basic purpose:
It returns unique values.
Suppose:
city
Pune
Mumbai
Pune
Delhi
Mumbai
Query:
SELECT DISTINCT city
FROM customers;
Result:
Pune
Mumbai
Delhi
Duplicate values are removed from the result.
🔹 19. SELECT DISTINCT on Multiple Columns
You can use multiple columns:
SELECT DISTINCT city, department
FROM employees;
Important:
DISTINCT applies to the combination of selected columns.
So if two rows have the same city but different departments, they are considered different combinations.
🔹 20. SQL Query Example
Imagine an orders table:customer_id | name | city | age
101 | Alice | Mumbai | 28
102 | Bob | Pune | 32
103 | Carol | Delhi | 25
You can use SQL to retrieve specific information from this table.
🔹 2. What Is a Database?
A database is a structured system used to store and manage data.
A relational database stores information in tables.
For example:
Customers
Contains customer information.
Orders
Contains order information.
Products
Contains product information.
These tables can be related using common columns such as:
customer_id
This becomes extremely important when we learn JOINs.
🔹 3. What Is a Table?
A table consists of:
Rows
Each row generally represents one record.
Example: One customer
Columns
Each column represents an attribute.
Example: customer_id, name, city, age
So:
Row → Record
Column → Attribute
🔹 4. Your First SQL Query
The basic SQL query is:
SELECT *
FROM customers;
Let's break it down:
SELECT
Specifies what data you want.
*
Means: Select all columns.
FROM
Specifies the table from which you want the data.
customers
The table name.
So the query means:
Give me all columns from the customers table.
🔹 5. Selecting Specific Columns
You don't always need every column.
Suppose you only want:
Customer ID
Customer name
Use:
SELECT customer_id, name
FROM customers;
Result:
customer_id | name
101 | Alice
102 | Bob
103 | Carol
This is usually better than using SELECT * when you only need a few columns.
🔹 6. Selecting One Column
You can select a single column:
SELECT name
FROM customers;
Result:
name
Alice
Bob
Carol
🔹 7. Selecting Multiple Columns
Separate column names using commas:
SELECT name, city, age
FROM customers;
This returns only those three columns.
🔹 8. What Does * Mean?
The asterisk:
*
means: All columns.
Example:
SELECT *
FROM customers;
If the table has 10 columns, the query returns all 10.
However, in production environments, it is often better to explicitly specify the columns you need.
Instead of:
SELECT *
FROM customers;
prefer:
SELECT customer_id, name, city
FROM customers;
when those are the only fields required.
🔹 9. SQL Statements and Semicolon
SQL statements are commonly terminated with:
;
Example:
SELECT name
FROM customers;
The semicolon indicates the end of the SQL statement in many SQL environments.
🔹 10. SQL Is Declarative
This is an important concept.
When you write:
SELECT name
FROM customers;Bayesian Statistics is an approach to statistical inference that combines prior information with observed data to produce a posterior distribution representing updated beliefs about unknown parameters.💡 What are Prior, Likelihood and Posterior?
Prior represents information before observing the new data, likelihood describes how compatible the observed data is with different parameter values, and posterior represents the updated distribution after combining the prior and likelihood.💡 MLE vs MAP?
MLE estimates parameters using only the likelihood, while MAP combines the likelihood with a prior distribution.🎯 Practice Questions Q1. What are the three main components of Bayesian inference? Q2. What is the difference between prior and posterior probability? Q3. What is the difference between MLE and MAP? Q4. Why is the base rate important in Bayesian reasoning? Q5. What is the main difference between a confidence interval and a credible interval? 🎯 Key Takeaways ✅ Bayesian Statistics = Prior + Data → Posterior ✅ Prior = Belief/information before observing new data. ✅ Likelihood = How compatible the observed data is with different parameter values. ✅ Posterior = Updated belief after considering the data. ✅ Posterior ∝ Prior × Likelihood ✅ MLE uses likelihood. ✅ MAP uses prior + likelihood. ✅ Bayesian methods naturally represent uncertainty using probability distributions. ✅ Naive Bayes is a major Machine Learning algorithm based on Bayes' theorem. ✅ Bayesian inference is especially useful when information arrives sequentially and beliefs need to be updated. 👉 Double Tap ❤️ For More ----- 1.56 ₽ · /balance_help
from scipy.stats import beta
alpha_prior = 2
beta_prior = 2
successes = 7
failures = 3
alpha_posterior = alpha_prior + successes
beta_posterior = beta_prior + failures
posterior_mean = alpha_posterior / (alpha_posterior + beta_posterior)
print("Posterior Mean:", posterior_mean)What is the probability that this person actually has the disease?This is not simply 99%. We need to consider: The prior probability of the disease, The probability of a positive test among people with the disease, The probability of a positive test among people without the disease. Bayes' theorem combines these pieces of information. 🔹 8. Solving the Example Let's assume: P(Disease) = 0.01 P(Positive | Disease) = 0.99 P(No Disease) = 0.99 P(Positive | No Disease) = 0.05 First calculate the overall probability of a positive test: P(Positive) = (0.99 × 0.01) + (0.05 × 0.99) = 0.0099 + 0.0495 = 0.0594 Now: P(Disease | Positive) = (0.99 × 0.01) / 0.0594 ≈ 0.167 So the probability is approximately 16.7%. This is much lower than 99%. Because the disease is relatively rare and false positives occur. This demonstrates why base rates matter. 🔹 9. Base Rate The base rate is the underlying frequency of an event in the population. In the previous example: Disease prevalence = 1%. That's the base rate. Ignoring the base rate can lead to incorrect conclusions. This is known as the Base Rate Fallacy. A test can be highly accurate while the probability that a randomly selected person with a positive result actually has the disease can still be considerably lower than expected if the condition is rare. 🔹 10. Bayesian Updating One of the most useful ideas in Bayesian Statistics is updating. Suppose we initially believe: Probability of an event = 20%. Then we observe strong evidence supporting the event. Our posterior might become: 45%. Then we receive additional evidence. The probability might update again: 65%. The process continues as new evidence arrives. So Bayesian inference is naturally suited to situations where:
New information arrives continuously.🔹 11. Prior, Likelihood and Posterior A simple way to remember the three: 🟦 Prior - What did I believe before seeing the data? 🟨 Likelihood - How strongly does the observed data support different possibilities? 🟩 Posterior - What do I believe after considering the data? Remember: Posterior ∝ Prior × Likelihood 🔹 12. Bayesian vs Frequentist Statistics Frequentist Approach: Generally treats unknown parameters as fixed but unknown. Probability is associated with the behavior of random data and procedures. Examples include: p-values, Confidence intervals, Hypothesis testing Bayesian Approach: Treats uncertainty about parameters using probability distributions. It combines: Prior information + Data → Posterior. Examples include: Posterior distributions, Credible intervals, Bayesian parameter estimation 🔹 13. Confidence Interval vs Credible Interval Confidence Interval: A frequentist concept. A 95% confidence interval is interpreted through the long-run behavior of the procedure that generates the interval. Credible Interval: A Bayesian concept.
Start with prior information, observe new data, and update your belief to obtain a posterior distribution.Bayesian methods are widely used in: Machine Learning, Classification, Medical diagnosis, Spam detection, Risk analysis, Recommendation systems, A/B testing, Natural Language Processing. 🔹 1. What Is Bayesian Statistics? Suppose a company wants to determine whether a customer is likely to purchase a product. Before seeing any new information, we may already have some historical knowledge about the customer's purchase probability. Then we observe new information: Previous purchases, Website activity, Product views, Time spent on the website. We can combine the previous information with the new evidence. This produces an updated belief. That is the basic idea of Bayesian Statistics. 🔹 2. Bayes' Theorem Bayesian inference is based on Bayes' Theorem. The simple form is: P(A | B) = [P(B | A) × P(A)] / P(B) Where: P(A | B) = Probability of A given B P(B | A) = Probability of B given A P(A) = Prior probability of A P(B) = Probability of observing B In Bayesian terminology: Posterior ∝ Likelihood × Prior This is one of the most important relationships to remember. 🔹 3. Prior Probability The prior represents our initial belief about a parameter or hypothesis before observing the new data. For example: Suppose historical data shows that approximately 10% of customers purchase a particular product. Before analyzing today's customer behavior, we might use: Prior probability = 10% The prior can come from: Historical data, Previous experiments, Domain knowledge, Earlier studies, Expert knowledge 🔹 4. Likelihood The likelihood tells us how compatible the observed data is with a particular hypothesis or parameter value. Suppose we observe that a customer: Visited the product page 10 times, Added the product to the cart, Returned to the website multiple times We can ask:
How likely is this behavior if the customer is actually going to purchase?This information contributes to the likelihood. 🔹 5. Posterior Probability The posterior is our updated belief after considering the observed data. In simple terms: Prior + Evidence → Posterior For example: Before observing new behavior: Purchase probability = 10%. After observing strong purchase-related behavior: Updated probability = 35%. The 35% represents our updated belief based on the evidence and prior information. 🔹 6. The Bayesian Process Bayesian inference can be thought of as a cycle: Step 1: Start with a Prior - What did we believe before seeing the new data? Step 2: Collect Data - Observe new evidence. Step 3: Calculate Likelihood - How compatible is the evidence with different possibilities? Step 4: Update - Combine prior and likelihood. Step 5: Obtain Posterior - The posterior becomes our updated belief. 🔹 7. Simple Example: Medical Testing
