Account
Data Science & Machine Learning

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

Username
@datasciencefun
Created
, 6 years
Subscribers77,469
Avg views per post, 7d1,112−26.7% vs prev 7d
ERR1.43%last 7 days

Average views per post by day

By publication day

Show as table
DateAvg views per post
Nov 17, 20262,260
Nov 18, 20261,640
Nov 19, 20261,925
Nov 20, 20261,830
Nov 21, 20261,820
Nov 22, 20261,530
Nov 23, 20261,770
Nov 24, 20261,315
Nov 27, 20261,770
Nov 30, 2026782

Most viewed this month

  1. Example: GROUP BY: SELECT department, AVG(salary) AS average_salary FROM employees GROUP BY department; Window Function: SELECT employee_name, department, salary, AVG(salary) OVER ( PARTITION BY department ) AS average_salary FROM employees; Remember: GROUP BY summarizes rows, while Window Functions calculate values across rows without collapsing them into one row per group. 🔹 9. Window Functions vs Regular Aggregate Functions Regular aggregate function: SELECT AVG(salary) FROM employees; Returns one average value. Window aggregate function: SELECT employee_name, salary, AVG(salary) OVER () AS average_salary FROM employees; Returns every employee along with the average salary. This is why Window Functions are so useful in analytical queries. 🔹 10. Real-World Data Science Use Cases Window Functions are frequently used for: • Calculating running sales totals. • Comparing employee salaries with department averages. • Calculating cumulative revenue. • Finding monthly sales trends. • Calculating moving averages. • Comparing current and previous transactions. • Analyzing customer purchase behavior. • Preparing analytical datasets for dashboards. 🔹 11. Common Mistakes to Avoid • Forgetting the OVER() clause. • Confusing PARTITION BY with GROUP BY. • Assuming PARTITION BY reduces the number of rows. • Using ORDER BY without understanding its effect on the window calculation. • Forgetting to define a proper window frame for running totals. • Assuming the ORDER BY inside OVER() sorts the final query output. Important: The ORDER BY inside OVER() controls the window calculation. To sort the final result, use an outer ORDER BY clause. 🔹 12. SQL Interview Questions Q1. What is a Window Function in SQL? A function that performs calculations across a set of related rows without collapsing them into a single row. Q2. What is the purpose of OVER()? It defines the window of rows used by the Window Function. Q3. What is PARTITION BY? It divides rows into groups for window calculations without reducing the number of rows. Q4. What is the difference between GROUP BY and PARTITION BY? GROUP BY combines rows into summarized groups, while PARTITION BY creates logical groups for window calculations and retains individual rows. Q5. What is a Running Total? A cumulative sum calculated progressively across ordered rows. 🎯 Practice Questions Try writing SQL queries for these problems: • Calculate the average salary across all employees using a Window Function. • Calculate department-wise average salary while displaying every employee. • Calculate total sales across all transactions. • Calculate a running total of sales ordered by transaction date. • Find the highest and lowest salary while displaying every employee. 🎯 Key Takeaways • Window Functions perform calculations across related rows. • OVER() defines the window. • PARTITION BY divides rows into groups. • ORDER BY defines the calculation order. • Aggregate functions such as SUM, AVG, COUNT, MIN, and MAX can be used as Window Functions. • Window Functions preserve individual rows. • Running totals are a common use case. • Window Functions are essential for advanced SQL analytics. Double Tap ❤️ For More

    Text
    Views2.37K
    Forwards—
    Reactions6
    Comments—
  2. 🚨Here is a comprehensive list of #interview questions that are commonly asked in job interviews for Data Scientist, Data Analyst, and Data Engineer positions: ➡️ Data Scientist Interview Questions Technical Questions 1) What are your preferred programming languages for data science, and why? 2) Can you write a Python script to perform data cleaning on a given dataset? 3) Explain the Central Limit Theorem. 4) How do you handle missing data in a dataset? 5) Describe the difference between supervised and unsupervised learning. 6) How do you select the right algorithm for your model? Questions Related To Problem-Solving and Projects 7) Walk me through a data science project you have worked on. 8) How did you handle data preprocessing in your project? 9) How do you evaluate the performance of a machine learning model? 10) What techniques do you use to prevent overfitting? ➡️Data Analyst Interview Questions Technical Questions 1) Write a SQL query to find the second highest salary from the employee table. 2) How would you optimize a slow-running query? 3) How do you use pivot tables in Excel? 4) Explain the VLOOKUP function. 5) How do you handle outliers in your data? 6) Describe the steps you take to clean a dataset. Analytical Questions 7) How do you interpret data to make business decisions? 8) Give an example of a time when your analysis directly influenced a business decision. 9) What are your preferred tools for data analysis and why? 10) How do you ensure the accuracy of your analysis? ➡️Data Engineer Interview Questions Technical Questions 1) What is your experience with SQL and NoSQL databases? 2) How do you design a scalable database architecture? 3) Explain the ETL process you follow in your projects. 4) How do you handle data transformation and loading efficiently? 5) What is your experience with Hadoop/Spark? 6) How do you manage and process large datasets? Questions Related To Problem-Solving and Optimization 7) Describe a data pipeline you have built. 8) What challenges did you face, and how did you overcome them? 9) How do you ensure your data processes run efficiently? 10) Describe a time when you had to optimize a slow data pipeline. I have curated Data Analytics Resources 👇👇 https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02 Hope this helps you 😊

    Text
    Views2.31K
    Forwards—
    Reactions2
    Comments—
  3. DATA SCIENCE INTERVIEW QUESTIONS WITH ANSWERS 1. What are the assumptions required for linear regression? What if some of these assumptions are violated? Ans: The assumptions are as follows: The sample data used to fit the model is representative of the population The relationship between X and the mean of Y is linear The variance of the residual is the same for any value of X (homoscedasticity) Observations are independent of each other For any value of X, Y is normally distributed. Extreme violations of these assumptions will make the results redundant. Small violations of these assumptions will result in a greater bias or variance of the estimate. 2.What is multicollinearity and how to remove it? Ans: Multicollinearity exists when an independent variable is highly correlated with another independent variable in a multiple regression equation. This can be problematic because it undermines the statistical significance of an independent variable. You could use the Variance Inflation Factors (VIF) to determine if there is any multicollinearity between independent variables — a standard benchmark is that if the VIF is greater than 5 then multicollinearity exists. 3. What is overfitting and how to prevent it? Ans: Overfitting is an error where the model ‘fits’ the data too well, resulting in a model with high variance and low bias. As a consequence, an overfit model will inaccurately predict new data points even though it has a high accuracy on the training data. Few approaches to prevent overfitting are: - Cross-Validation:Cross-validation is a powerful preventative measure against overfitting. Here we use our initial training data to generate multiple mini train-test splits. Now we use these splits to tune our model. - Train with more data: It won’t work every time, but training with more data can help algorithms detect the signal better or it can help my model to understand general trends in particular. - We can remove irrelevant information or the noise from our dataset. - Early Stopping: When you’re training a learning algorithm iteratively, you can measure how well each iteration of the model performs. Up until a certain number of iterations, new iterations improve the model. After that point, however, the model’s ability to generalize can weaken as it begins to overfit the training data. Early stopping refers stopping the training process before the learner passes that point. - Regularization: It refers to a broad range of techniques for artificially forcing your model to be simpler. There are mainly 3 types of Regularization techniques:L1, L2,&,Elastic- net. - Ensembling : Here we take number of learners and using these we get strong model. They are of two types : Bagging and Boosting. 4. Given two fair dices, what is the probability of getting scores that sum to 4 and 8? Ans: There are 4 combinations of rolling a 4 (1+3, 3+1, 2+2): P(rolling a 4) = 3/36 = 1/12 There are 5 combinations of rolling an 8 (2+6, 6+2, 3+5, 5+3, 4+4): P(rolling an 8) = 5/36 ENJOY LEARNING 👍👍

    Text
    Views2.26K
    Forwards—
    Reactions6
    Comments—
  4. Views1.83K
    Forwards—
    Reactions—
    Comments—

Latest posts

#4757Text

Forwarded from Free Courses with Certificate - Python Programming, Data Science, Java Coding, SQL, Web Development, AI, ML, ChatGPT Expert

✅ AI CAN'T HELP YOU I know this might sound odd, especially when AI is becoming a part of almost everything we do. But here's the truth. People are becoming so dependent on AI that they're slowly forgetting one important thing: AI can assist you, but it cannot live your life for you. 💼 You Can't Build a Successful Business With Just AI. AI can give you business ideas, marketing strategies, business plans, and automation tools. But it cannot replace your patience, consistency, decision-making, leadership, or willingness to take risks. Building a business requires learning multiple skills, understanding people, facing failures, adapting to challenges, and having the resilience to keep going when things don't work out. AI can show you the direction, but you have to walk the path. 📚 AI Can't Help You Pass Exams. It can create study plans, explain difficult concepts, provide learning resources, and help you understand topics faster. But it cannot sit for hours studying, practise questions, revise concepts, or sacrifice distractions for your goals. You still have to put in those late-night study sessions, build your fundamentals, and dedicate yourself to learning. 💻 AI Can't Build Your Career for You. It can improve your resume, prepare you for interviews, suggest skills to learn, and help you solve technical problems. But it cannot gain real-world experience on your behalf, develop your professional judgment, or build your confidence through practice. 🏋️ AI Can't Transform Your Body. It can create workout routines, suggest diets, and help you track progress. But it cannot do the workouts, control your daily choices, or maintain discipline when motivation disappears. Here's what I want you to understand: AI is an incredibly powerful tool. Use it to save time, learn faster, explore possibilities, and become more productive. But don't become so dependent on it that you forget how to think, learn, solve problems, and make decisions independently. You don't need another roadmap if you're never going to follow it. You don't need another business idea if you're afraid to execute it. You don't need another motivational quote if you're unwilling to put in the work. AI can give you the knowledge, tools, strategies, and direction. But the patience, hard work, discipline, courage, and action must come from YOU. Double Tap ♥️ If You Agree

Open in Telegram
Views686−54%vs avg
Forwards—
Reactions12
Comments—
#4756Photo
Views879−41%vs avg
Forwards—
Reactions1
Comments—
#4755Text

🗄️ How to Solve SQL Problems If you are a beginner, don't try to write the entire SQL query immediately. The easiest approach is to break the problem into small steps. 📌 Step 1: Understand What the Question Is Asking Read the question carefully and identify the final output. Example: Find the total sales for each customer. Ask yourself: 👉 What do I need to display? Answer: Customer Total Sales 📌 Step 2: Identify the Table Find which table contains the required information. Suppose you have: sales customer_id product quantity price You need the sales table. 📌 Step 3: Identify the Required Columns For: Find total sales for each customer. You need: customer_id quantity price Because: Sales = quantity × price 📌 Step 4: Decide Whether You Need Filtering Ask: Do I need only certain rows? For example: Find total sales for customers who purchased in 2026. Now you need a WHERE condition. WHERE order_date >= '2026-01-01' 📌 Step 5: Decide Whether You Need GROUP BY Look for words such as: Each customer, Each department, Per product, By region, By month These usually indicate GROUP BY. For example: Find total sales for each customer. GROUP BY customer_id 📌 Step 6: Identify the Required Aggregate Function Look for words like: Total → SUM() Average → AVG() Count → COUNT() Maximum → MAX() Minimum → MIN() For total sales: SUM(quantity _ price) 📌 Step 7: Build the Query Step by Step Instead of writing everything at once: 1. SELECT customer_id FROM sales; 2. Add the calculation: SELECT customer_id, SUM(quantity _ price) AS total_sales FROM sales; 3. Add grouping: SELECT customer_id, SUM(quantity * price) AS total_sales FROM sales GROUP BY customer_id; Now the query is complete. 📌 Step 8: Check Whether You Need HAVING Suppose the question changes to: Find customers whose total sales are greater than ₹50,000. You cannot use WHERE on SUM(). Use HAVING: SELECT customer_id, SUM(quantity * price) AS total_sales FROM sales GROUP BY customer_id HAVING SUM(quantity * price) > 50000; 📌 Step 9: Check Whether You Need a JOIN Suppose the question says: Find the names of customers and their total sales. You have: customers: customer_id, customer_name sales: customer_id, quantity, price Now you need a JOIN. SELECT c.customer_name, SUM(s.quantity * s.price) AS total_sales FROM customers c JOIN sales s ON c.customer_id = s.customer_id GROUP BY c.customer_name; 📌 Step 10: Validate Your Answer Before considering the problem solved, check: ✓ Did I use the correct table? ✓ Did I select the correct columns? ✓ Is my JOIN correct? ✓ Did I handle NULL values? ✓ Did I accidentally create duplicates? ✓ Did I use WHERE or HAVING correctly? ✓ Does the output actually answer the question? 🧠 Use This SQL Problem-Solving Framework Whenever you get a SQL question, think: 1. What is being asked? 2. Which table(s) do I need? 3. Which columns do I need? 4. Do I need filtering? 5. Do I need a JOIN? 6. Do I need aggregation? 7. Do I need GROUP BY? 8. Do I need HAVING? 9. Do I need a window function? 10. Validate the result 🔥 Double Tap ❤️ For More SQL Tips

Open in Telegram
Views1,770+19%vs avg
Forwards—
Reactions5
Comments—
#4754Text

Example: GROUP BY: SELECT department, AVG(salary) AS average_salary FROM employees GROUP BY department; Window Function: SELECT employee_name, department, salary, AVG(salary) OVER ( PARTITION BY department ) AS average_salary FROM employees; Remember: GROUP BY summarizes rows, while Window Functions calculate values across rows without collapsing them into one row per group. 🔹 9. Window Functions vs Regular Aggregate Functions Regular aggregate function: SELECT AVG(salary) FROM employees; Returns one average value. Window aggregate function: SELECT employee_name, salary, AVG(salary) OVER () AS average_salary FROM employees; Returns every employee along with the average salary. This is why Window Functions are so useful in analytical queries. 🔹 10. Real-World Data Science Use Cases Window Functions are frequently used for: • Calculating running sales totals. • Comparing employee salaries with department averages. • Calculating cumulative revenue. • Finding monthly sales trends. • Calculating moving averages. • Comparing current and previous transactions. • Analyzing customer purchase behavior. • Preparing analytical datasets for dashboards. 🔹 11. Common Mistakes to Avoid • Forgetting the OVER() clause. • Confusing PARTITION BY with GROUP BY. • Assuming PARTITION BY reduces the number of rows. • Using ORDER BY without understanding its effect on the window calculation. • Forgetting to define a proper window frame for running totals. • Assuming the ORDER BY inside OVER() sorts the final query output. Important: The ORDER BY inside OVER() controls the window calculation. To sort the final result, use an outer ORDER BY clause. 🔹 12. SQL Interview Questions Q1. What is a Window Function in SQL? A function that performs calculations across a set of related rows without collapsing them into a single row. Q2. What is the purpose of OVER()? It defines the window of rows used by the Window Function. Q3. What is PARTITION BY? It divides rows into groups for window calculations without reducing the number of rows. Q4. What is the difference between GROUP BY and PARTITION BY? GROUP BY combines rows into summarized groups, while PARTITION BY creates logical groups for window calculations and retains individual rows. Q5. What is a Running Total? A cumulative sum calculated progressively across ordered rows. 🎯 Practice Questions Try writing SQL queries for these problems: • Calculate the average salary across all employees using a Window Function. • Calculate department-wise average salary while displaying every employee. • Calculate total sales across all transactions. • Calculate a running total of sales ordered by transaction date. • Find the highest and lowest salary while displaying every employee. 🎯 Key Takeaways • Window Functions perform calculations across related rows. • OVER() defines the window. • PARTITION BY divides rows into groups. • ORDER BY defines the calculation order. • Aggregate functions such as SUM, AVG, COUNT, MIN, and MAX can be used as Window Functions. • Window Functions preserve individual rows. • Running totals are a common use case. • Window Functions are essential for advanced SQL analytics. Double Tap ❤️ For More

Open in Telegram
Views2,370+59%vs avg
Forwards—
Reactions6
Comments—
#4752Text
Views1,420−5%vs avg
Forwards—
Reactions2
Comments—
#4749Text

The average salary is calculated across all employees and displayed on every row. 🔹 4. What is PARTITION BY? PARTITION BY divides records into separate groups for calculations. Example: Calculate average salary department-wise. SELECT employee_name, department, salary, AVG(salary) OVER ( PARTITION BY department ) AS department_average FROM employees; Here: • IT employees are calculated together. • HR employees are calculated together. • Finance employees are calculated together. However, all employee records remain visible. Important: PARTITION BY does not physically group or sort the original table. It defines the groups used by the window calculation. 🔹 5. Aggregate Window Functions You can use aggregate functions with Window Functions. The most commonly used are: 1. SUM() OVER() Calculate total salary across all employees. SELECT employee_name, salary, SUM(salary) OVER () AS total_salary FROM employees; 2. AVG() OVER() Calculate average salary. SELECT employee_name, salary, AVG(salary) OVER () AS average_salary FROM employees; 3. COUNT() OVER() Count the total number of employees. SELECT employee_name, COUNT(*) OVER () AS total_employees FROM employees; 4. MAX() OVER() Find the highest salary. SELECT employee_name, salary, MAX(salary) OVER () AS highest_salary FROM employees; 5. MIN() OVER() Find the lowest salary. SELECT employee_name, salary, MIN(salary) OVER () AS lowest_salary FROM employees; 🔹 6. Window Functions with ORDER BY You can use ORDER BY inside OVER() to perform calculations based on row order. Example: Calculate running total of sales. Suppose we have a sales table:

Open in Telegram
Views1,160−22%vs avg
Forwards—
Reactions—
Comments—
#4748Text
Views1,170−22%vs avg
Forwards—
Reactions—
Comments—

All posts

Connections