Data Science & Machine Learning
77.8K subscribers
898 photos
1 video
68 files
817 links
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
Download Telegram
Which method adds an element at the end of a list?
Anonymous Quiz
9%
A) add()
77%
B) append()
9%
C) insert()
5%
D) push()
โค2
Which data structure stores values in keyโ€“value pairs?
Anonymous Quiz
7%
A) List
9%
B) Tuple
79%
C) Dictionary
6%
D) Set
โค2
What will be the output?

nums = {1, 2, 2, 3} print(nums)
Anonymous Quiz
44%
A) {1, 2, 2, 3}
38%
B) {1, 2, 3}
13%
C) Error
5%
D) [1, 2, 3]
๐Ÿค”5โค2
Amazon Interview Process for Data Scientist position

๐Ÿ“Round 1- Phone Screen round
This was a preliminary round to check my capability, projects to coding, Stats, ML, etc.

After clearing this round the technical Interview rounds started. There were 5-6 rounds (Multiple rounds in one day).

๐Ÿ“ ๐—ฅ๐—ผ๐˜‚๐—ป๐—ฑ ๐Ÿฎ- ๐——๐—ฎ๐˜๐—ฎ ๐—ฆ๐—ฐ๐—ถ๐—ฒ๐—ป๐—ฐ๐—ฒ ๐—•๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐˜๐—ต:
In this round the interviewer tested my knowledge on different kinds of topics.

๐Ÿ“๐—ฅ๐—ผ๐˜‚๐—ป๐—ฑ ๐Ÿฏ- ๐——๐—ฒ๐—ฝ๐˜๐—ต ๐—ฅ๐—ผ๐˜‚๐—ป๐—ฑ:
In this round the interviewers grilled deeper into 1-2 topics. I was asked questions around:
Standard ML tech, Linear Equation, Techniques, etc.

๐Ÿ“๐—ฅ๐—ผ๐˜‚๐—ป๐—ฑ ๐Ÿฐ- ๐—–๐—ผ๐—ฑ๐—ถ๐—ป๐—ด ๐—ฅ๐—ผ๐˜‚๐—ป๐—ฑ-
This was a Python coding round, which I cleared successfully.

๐Ÿ“๐—ฅ๐—ผ๐˜‚๐—ป๐—ฑ ๐Ÿฑ- This was ๐—›๐—ถ๐—ฟ๐—ถ๐—ป๐—ด ๐— ๐—ฎ๐—ป๐—ฎ๐—ด๐—ฒ๐—ฟ where my fitment for the team got assessed.

๐Ÿ“๐—Ÿ๐—ฎ๐˜€๐˜ ๐—ฅ๐—ผ๐˜‚๐—ป๐—ฑ- ๐—•๐—ฎ๐—ฟ ๐—ฅ๐—ฎ๐—ถ๐˜€๐—ฒ๐—ฟ- Very important round, I was asked heavily around Leadership principles & Employee dignity questions.

So, here are my Tips if youโ€™re targeting any Data Science role:
-> Never make up stuff & donโ€™t lie in your Resume.
-> Projects thoroughly study.
-> Practice SQL, DSA, Coding problem on Leetcode/Hackerank.
-> Download data from Kaggle & build EDA (Data manipulation questions are asked)

Best Data Science & Machine Learning Resources: https://topmate.io/coding/914624

ENJOY LEARNING ๐Ÿ‘๐Ÿ‘
โค8
โœ… Python Loops (for & while)

Loops help repeat tasks automatically โ€” very important for data processing and automation.

๐Ÿ”น 1. What are Loops?
Loops repeat a block of code multiple times.
๐Ÿ‘‰ Used in:
โœ… Data cleaning
โœ… Data analysis
โœ… Machine learning
โœ… Automation

๐Ÿ”ฅ 2. for Loop (Most Used) โญ
Used to iterate over a sequence (list, string, range).

โœ… Basic Syntax
for variable in sequence:
    # code

โœ… Example โ€” Print Numbers
for i in range(5):
    print(i)

Output: 0 1 2 3 4
๐Ÿ‘‰ range(5) โ†’ generates numbers from 0 to 4.

โœ… Loop Through List (Very Important)
numbers = [10, 20, 30]
for num in numbers:
    print(num)

๐Ÿ‘‰ Used heavily in data science.

๐Ÿ”ฅ 3. while Loop
Runs until condition becomes False.

โœ… Syntax
while condition:
    # code

โœ… Example
x = 1
while x <= 5:
    print(x)
    x += 1

Output: 1 2 3 4 5
๐Ÿ‘‰ Important: Update condition to avoid infinite loop.

๐Ÿ”น 4. Loop Control Statements (Very Important)

โœ… break โ†’ stop loop
for i in range(5):
    if i == 3:
        break
    print(i)

Output: 0 1 2

โœ… continue โ†’ skip current iteration
for i in range(5):
    if i == 3:
        continue
    print(i)

Output: 0 1 2 4

๐ŸŽฏ Todayโ€™s Goal
โœ… Use for loop
โœ… Use while loop
โœ… Understand break & continue

Double Tap โ™ฅ๏ธ For More
โค16๐Ÿ‘1
Which loop is mostly used to iterate over a list or sequence in Python?
Anonymous Quiz
18%
A) while loop
13%
B) do-while loop
66%
C) for loop
2%
D) repeat loop
โค3
Which statement stops a loop immediately?
Anonymous Quiz
4%
A) stop
9%
B) exit
86%
C) break
2%
D) continue
โค2
What happens if we donโ€™t update the condition inside a while loop?
Anonymous Quiz
10%
A) Syntax error
17%
B) Program stops automatically
68%
C) Infinite loop
4%
D) Nothing happens
โค2
Which function generates a sequence of numbers for looping?
Anonymous Quiz
19%
A) loop()
55%
B) range()
11%
C) generate()
15%
D) sequence()
โค2
โœ… Python Functions ๐Ÿโš™๏ธ

Functions are very important in data science. They help you write reusable, clean, and modular code.

๐Ÿ”น 1. What is a Function?
A function is a block of code that performs a specific task.
๐Ÿ‘‰ Instead of writing the same code again and again, we create a function.

๐Ÿ”ฅ 2. Creating a Function

โœ… Basic Syntax
def function_name():
# code


โœ… Example
def greet():
print("Hello Deepak")
greet()

Output: Hello Deepak

๐Ÿ”น 3. Function with Parameters

Parameters allow input to functions.

def greet(name):
print("Hello", name)
greet("Rahul")

# Output: Hello Rahul

๐Ÿ”น 4. Function with Return Value (Very Important โญ)

Instead of printing, functions can return values.

def add(a, b):
return a + b
result = add(5, 3)
print(result)

# Output: 8

๐Ÿ‘‰ return sends value back.

๐Ÿ”น 5. Default Parameters

def greet(name="Guest"):
print("Hello", name)
greet()
greet("Amit")


๐Ÿ”น 6. Why Functions Matter in Data Science?
โœ… Data cleaning functions
โœ… Feature engineering functions
โœ… Reusable ML pipelines
โœ… Code organization

๐ŸŽฏ Todayโ€™s Goal
โœ” Understand def
โœ” Use parameters
โœ” Use return
โœ” Call functions properly

Double Tap โ™ฅ๏ธ For More
โค25๐Ÿ‘1
๐Ÿ” Machine Learning Cheat Sheet ๐Ÿ”

1. Key Concepts:
- Supervised Learning: Learn from labeled data (e.g., classification, regression).
- Unsupervised Learning: Discover patterns in unlabeled data (e.g., clustering, dimensionality reduction).
- Reinforcement Learning: Learn by interacting with an environment to maximize reward.

2. Common Algorithms:
- Linear Regression: Predict continuous values.
- Logistic Regression: Binary classification.
- Decision Trees: Simple, interpretable model for classification and regression.
- Random Forests: Ensemble method for improved accuracy.
- Support Vector Machines: Effective for high-dimensional spaces.
- K-Nearest Neighbors: Instance-based learning for classification/regression.
- K-Means: Clustering algorithm.
- Principal Component Analysis(PCA)

3. Performance Metrics:
- Classification: Accuracy, Precision, Recall, F1-Score, ROC-AUC.
- Regression: Mean Absolute Error (MAE), Mean Squared Error (MSE), R^2 Score.

4. Data Preprocessing:
- Normalization: Scale features to a standard range.
- Standardization: Transform features to have zero mean and unit variance.
- Imputation: Handle missing data.
- Encoding: Convert categorical data into numerical format.

5. Model Evaluation:
- Cross-Validation: Ensure model generalization.
- Train-Test Split: Divide data to evaluate model performance.

6. Libraries:
- Python: Scikit-Learn, TensorFlow, Keras, PyTorch, Pandas, Numpy, Matplotlib.
- R: caret, randomForest, e1071, ggplot2.

7. Tips for Success:
- Feature Engineering: Enhance data quality and relevance.
- Hyperparameter Tuning: Optimize model parameters (Grid Search, Random Search).
- Model Interpretability: Use tools like SHAP and LIME.
- Continuous Learning: Stay updated with the latest research and trends.

๐Ÿš€ Dive into Machine Learning and transform data into insights! ๐Ÿš€

Best Data Science & Machine Learning Resources: https://topmate.io/coding/914624

All the best ๐Ÿ‘๐Ÿ‘
โค9
โœ… Conditional Statements (ifโ€“else) ๐Ÿโšก

Conditional statements allow programs to make decisions based on conditions.

๐Ÿ‘‰ Used heavily in:
โœ” Data filtering
โœ” Business rules
โœ” Machine learning logic

๐Ÿ”น 1. if Statement
Used to execute code when a condition is True.

โœ… Syntax
if condition:
# code


Example
age = 20
if age >= 18:
print("You can vote")

# Output: You can vote

๐Ÿ”น 2. ifโ€“else Statement
Used when there are two possible outcomes.

Syntax
if condition:
# code if true
else:
# code if false


Example
age = 16
if age >= 18:
print("Eligible to vote")
else:
print("Not eligible")


๐Ÿ”น 3. ifโ€“elifโ€“else Statement
Used when there are multiple conditions.

Syntax
if condition1:
# code
elif condition2:
# code
else:
# code


Example
marks = 75
if marks >= 90:
print("Grade A")
elif marks >= 60:
print("Grade B")
else:
print("Grade C")


๐Ÿ”น 4. Nested if Statement
An if statement inside another if.

age = 20
citizen = True
if age >= 18:
if citizen:
print("Eligible to vote")


๐Ÿ”น 5. Short if (Ternary Operator)
age = 20
print("Adult") if age >= 18 else print("Minor")


๐ŸŽฏ Todayโ€™s Goal
โœ” Understand if
โœ” Use ifโ€“else
โœ” Use elif for multiple conditions
โœ” Learn nested conditions

๐Ÿ‘‰ Conditional logic is used in data filtering and decision models.

Double Tap โ™ฅ๏ธ For More
โค16๐Ÿ‘1
Which keyword is used to check a condition in Python?
Anonymous Quiz
9%
A) check
82%
B) if
4%
C) when
4%
D) condition
โค3
What will be the output?

x = 10 if x > 5: print("Yes") else: print("No")
Anonymous Quiz
88%
Yes
12%
No
โค3
Which keyword is used to check multiple conditions?
Anonymous Quiz
14%
A) elseif
59%
B) elif
23%
C) else if
4%
D) multiple
โค4
๐Ÿ”น Q4. What will be the output?

x = 7 if x > 10: print("A") elif x > 5: print("B") else: print("C")
Anonymous Quiz
13%
A
75%
B
10%
C
2%
D
โค2
What will be the output?

age = 16 print("Adult") if age >= 18 else print("Minor")
Anonymous Quiz
25%
Adult
75%
Minor
โค5๐Ÿ˜1
Now, let's move to the next topic of Data Science Roadmap:

โœ… Python Dictionaries ๐Ÿ“š

Dictionaries are one of the most important data structures in Python, especially in data science and real-world datasets. They store data in keyโ€“value pairs.

๐Ÿ”น 1. What is a Dictionary?
A dictionary stores data in key:value format.

โœ… Example:

student = { "name": "Rahul", "age": 22, "course": "Data Science" }
print(student)


Output: {'name': 'Rahul', 'age': 22, 'course': 'Data Science'}

โœ” Uses curly brackets {}

๐Ÿ”น 2. Access Dictionary Values

Use the key to access values.

student = { "name": "Rahul", "age": 22 }
print(student["name"])


Output: Rahul

๐Ÿ”น 3. Add New Elements

student = { "name": "Rahul", "age": 22 }
student["city"] = "Delhi"
print(student)


Output: {'name': 'Rahul', 'age': 22, 'city': 'Delhi'}

๐Ÿ”น 4. Modify Values

student["age"] = 23


๐Ÿ”น 5. Remove Elements

student.pop("age")


๐Ÿ”น 6. Important Dictionary Methods
โญ

โœ… Get Method:
print(student.get("name"))


Output: Rahul

โœ… Keys Method:
print(student.keys())


Output: dict_keys(['name', 'age'])

โœ… Values Method:
print(student.values())


Output: dict_values(['Rahul', 22])

โœ… Items Method:
print(student.items())


Output: dict_items([('name', 'Rahul'), ('age', 22)])

๐Ÿ”น 7. Loop Through Dictionary

student = { "name": "Rahul", "age": 22 }

for key, value in student.items():
print(key, value)


Output:
name Rahul
age 22

๐ŸŽฏ Todayโ€™s Goal
โœ” Understand keyโ€“value pairs
โœ” Access dictionary values
โœ” Add or update data
โœ” Loop through dictionary

๐Ÿ‘‰ Dictionaries are widely used in APIs, JSON data, and machine learning datasets.

Double Tap โ™ฅ๏ธ For More
โค21๐Ÿฅฐ1
Which symbol is used to create a dictionary in Python?
Anonymous Quiz
18%
A) []
9%
B) ()
71%
C) {}
3%
D) <>
โค2๐Ÿ˜ข1