CBSE CLASS 11 AI – Machine Learning Algorithms Notes
Q1. What is Machine Learning? Give one example.
It is the ability of a machine to learn from data and experience.
Example: Email spam filters learn to identify spam emails based on past data.
Q2. Name different types of Machine Learning
- Supervised Learning
- Unsupervised Learning
- Semi-supervised Learning
- Reinforcement Learning
Q3. What is supervised learning? Give an example.
Supervised learning is a type of machine learning where the model is trained using labeled data.
Example: Predicting student marks using previous exam data.
Q4. What is unsupervised learning? Give an example.
Unsupervised learning is a type of machine learning where the model is trained using unlabeled data to identify patterns and relationships.
Example: Grouping customers based on buying behavior.
Q5. What is semi supervised learning? Give an example.
Semi supervised learning uses a small amount of labeled data and a large amount of unlabeled data for training.
Example: Image recognition using few labeled images.
Q6. What is reinforcement learning? Write names of its components. Give an example.
Reinforcement learning is a learning method in which an agent learns by interacting with an environment and receiving rewards or penalties.
Components: Agent, Environment, Action, Reward.
Example: Teaching a computer to play a game (such as Chess or Ludo)
Q7. What is correlation?
Correlation is a statistical measure that shows the strength and direction of the relationship between two variables.
Q8. What is the importance of correlation in Machine Learning?
It helps in identifying features that influence predictions.
Q9. Explain the meaning of +1, 0, and –1 correlation values with examples.
a. Correlation = +1:
It indicates a perfect positive correlation, where both variables increase or decrease together.
Example: Increase in hours studied leads to increase in marks.
b. Correlation = 0:
This indicates no correlation, meaning there is no relationship between the variables.
Example: Shoe size and intelligence.
c. Correlation = –1:
This indicates a perfect negative correlation, where one variable increases while the other decreases.
Example: Speed of a vehicle and time taken to cover a fixed distance
Q10. Which coefficient is used to measure linear correlation?
Pearson’s Correlation Coefficient.
Q11. What is Pearson’s Correlation Coefficient?
Pearson’s Correlation Coefficient measures the linear relationship between two continuous variables. Its value lies between –1 and +1.
Q12. Write formula of Pearson’s Correlation Coefficient?

- X and 𝑌 are variables
- n is the number of observations
Q13. Write significance of Pearson’s Correlation Coefficient.
It helps to determine strength and direction of relationship
It is used in data analysis and feature selection
Q14. Finding Pearson’s Correlation Coefficient
| Hours Studied (X) | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| Marks (Y) | 40 | 50 | 60 | 70 |
Step 1: Write the formula

Step 2: Create a calculation table
| X | Y | X² | Y² | XY |
|---|---|---|---|---|
| 1 | 40 | 1 | 1600 | 40 |
| 2 | 50 | 4 | 2500 | 100 |
| 3 | 60 | 9 | 3600 | 180 |
| 4 | 70 | 16 | 4900 | 280 |
Step 3: Find the sums

Step 4: Substitute values in the formula

Q15. What is dependent variable and independent variable in given data?
Q16. What is causation? Give an example.
Causation means that one variable directly causes a change in another variable.
Example: Smoking causes lung disease.
Q17. Write difference between Correlation and Causation:
| Correlation | Causation |
|---|---|
| a. Shows a relationship between variables | a. Shows cause-and-effect |
| b. Does not imply direct cause | b. Always implies cause |
| c. May be coincidental | c. Scientifically proven |
| d. Example: Ice cream sales and drowning | d. Example: Fire causes smoke |
Q18. Explain with examples: (a) When correlation is causation and (b) When correlation is not causation.
(a) Correlation is causation:
When a change in one variable directly causes a change in another variable, correlation becomes causation.
Example: Increase in study hours causes better exam performance.
(b) Correlation is not causation:
Sometimes two variables are related but one does not cause the other.
Example: Ice cream sales and drowning cases increase in summer, but ice cream does not cause drowning. The real cause is hot weather.
Q19. Explain regression in Machine Learning. Define dependent and independent variables.
Regression is a supervised learning technique used to predict the value of a dependent variable based on one or more independent variables. It identifies the relationship between variables and is widely used for prediction.
Independent Variable (X): The input or predictor variable
Dependent Variable (Y): The output variable that depends on X
Example: Predicting marks (Y) based on hours studied (X).
Q20. What is the importance of regression?
Regression is useful in forecasting and decision-making.
21. What is a Regression Line?
A regression line is a straight line that best represents the relationship between an independent variable (X) and a dependent variable (Y).
It shows how the value of Y changes when X changes.
22. What are properties of Regression line.
1. Best Fit Line: The regression line is the line that fits the data points best.
2. Minimizes Errors: It reduces the total difference between actual values and predicted values.
3. Passes Through Mean Point: The line always passes through the average values of X and Y.
4. Shows Relationship Between Variables: It shows how the output (Y) changes when the input (X) changes.
5. Used for Prediction: It helps in predicting unknown values.
6. Straight Line: In linear regression, the regression line is always straight.
7. Depends on Correlation: Positive correlation gives an upward line, and negative correlation gives a downward line.
8. Only One Best Line: For one set of data, there is only one best regression line.
23. What is Linear Regression?
Linear Regression is a supervised machine learning technique used to predict a continuous value by establishing a linear relationship between input and output variables.
24. Write equation of Linear Regression?
y = mx + b+ E
Where:
y = dependent variable
x = independent variable
m = slope
b = intercept
E= Error (Difference between observed value and predicted value)
25. What is Ordinary Least Squares (OLS)?
Ordinary Least Squares (OLS) is a method used to find the best fit regression line by minimizing the sum of squared errors between actual and predicted values.
26. What is Error in Regression?
Error is the difference between the actual value and the predicted value.
Error =Actual Value-Predicted Value
27. Write properties of Regression Line
1. It minimizes the sum of squared errors
2. It passes through the mean of X and Y
3. It represents the best linear relationship between variables
4. It can be used for prediction
28. Write applications of Linear Regression.
1. Predicting house prices
2. Sales forecasting
3. Weather prediction
4. Predicting exam scores
5. Business trend analysis
29. Write advantages of Linear Regression
1. Simple and easy to understand
2. Fast to train
3. Works well with linear relationships
4. Easy to interpret results
30. Write disadvantages of Linear Regression
1. Assumes linear relationship
2. Sensitive to outliers
3. Cannot model complex patterns
4. Performance decreases with noisy data
31. What is Classification?
Classification is a supervised learning technique used to assign data into predefined categories or classes.
Example:: Email → Spam / Not Spam
32. How does Classification work?
i. Training Phase : Labelled data is given to the model. The model learns patterns from data
ii. Model Learns: It identifies features that differentiate classes
iii. Prediction Phase: New data is classified into one of the learned classes
33. Explain types of Classification problems.
a) Binary Classification : Classifies data into two classes.
Example:
Disease → Yes / No
Email → Spam / Not Spam
b) Multiclass Classification: Classifies data into more than two classes.
Example:
Digit recognition (0–9)
Fruit classification (Apple, Mango, Banana)
c) Multi Label Classification: One data item can belong to more than one class at the same time..
Example:
A movie can be classified as Action, SCI-FI and adventure together
d) Imbalanced Classification: one class has much more data than the other class(es).
Example:
In disease detection, healthy cases are many while disease cases are very few.
34. What is K-Nearest Neighbour (KNN)?
KNN is a supervised learning algorithm that classifies a data point based on the majority class of its nearest neighbours.
35. How Does KNN Work?
i. Training Phase
- Dataset Creation: Collection of labelled data (Example: Pictures of animals)
- Feature Selection: Define features of data ( Colour, Herbivorous/Carnivorous, Number of legs, Type of teeth)
ii. Prediction Phase
-
- Choose value of K
- Calculate distance (usually Euclidean distance)
- Select K nearest points
- Assign the majority class
36. How to choose the Value of K in KNN?
i. Small Value of K (e.g., K = 1)
The model considers only the nearest neighbor.
It may give wrong results due to noise.
Example:: If one wrong data point is very close, K = 1 will classify incorrectly.
ii. Large Value of K (e.g., K = 15)
The model considers many neighbors.
Prediction becomes more stable but may be less accurate.
Example:
Too many neighbors may include points from other classes.
iii. Odd Value of K is Preferred
Odd K avoids tie situations in binary classification.
Example:
K = 3 → clear majority
K = 4 → possible tie (2 vs 2)
iv. Choose K Using Trial and Error
Test different values of K and select the one giving the best accuracy.
Example:
Try K = 3, 5, 7 and choose the best-performing value.
v. General Rule
K should be neither too small nor too large.
A commonly used value is K = √n, where n is the number of data points.
Example:
If n = 25, then K = 5.
37. Write difference between Even vs Odd K in KNN.
Odd K is preferred to avoid tie situations
Even K may result in equal votes between classes
38 Write Applications of KNN.
- Image recognition
- Recommendation systems
- Medical diagnosis
- Pattern recognition
- Credit risk analysis
39. Write Advantages of KNN.
- Simple and easy to understand
- No training required
- Works well with small datasets
- Flexible and versatile
40. What is Unsupervised Learning?
Unsupervised learning is a type of machine learning where the model learns patterns from unlabeled data. The algorithm tries to discover hidden structures, relationships, or patterns without any predefined output.
41. Name different methods of Unsupervised Learning?
- Clustering
- Dimensionality Reduction
- Anomaly detection
42. What is clustering?
Clustering is an unsupervised learning technique that groups similar data points into clusters such that data points within the same cluster are more similar to each other than to those in other clusters.
43. Name some common clustering algorithms.
- KMeans Clustering
- Hierarchical Clustering
- DBSCAN
- Mean Shift
44. What are the uses of clustering?
- Market segmentation
- Image segmentation
- Document grouping
- Social network analysis
45. Explain the steps involved in a clustering algorithm.
i. Collect Data
Gather relevant data from different sources for analysis.
ii.. Preprocess Data
Clean the data by handling missing values, removing noise, and normalizing features.
iii. Choose Number of Clusters (K)
Decide how many clusters to form using methods like the Elbow Method.
iv. Initialize Centroids
Randomly select K data points as initial cluster centers (centroids).
v. Assign Data Points to Clusters
Assign each data point to the nearest centroid using a distance metric (e.g., Euclidean distance).
vi. Update Cluster Centroids
Recalculate centroids by taking the mean of all data points in each cluster.
vii. Evaluate Clustering
Measure clustering quality using metrics such as Silhouette Score or WithinCluster Sum of Squares (WCSS).
viii. Visualize Results
Plot clusters using graphs or charts to interpret and analyze the results.
46. What is dimensionality reduction?
Dimensionality reduction is a technique used to reduce the number of input features while preserving important information. It makes data easier to visualize and process.
47. Why is dimensionality reduction important?
- Reduces computational cost
- Removes duplicate features
- Helps in data visualization
- Improves model performance
48. What is anomaly detection?
Anomaly detection is an unsupervised learning technique used to identify data points that significantly differ from the normal pattern of data.
49. Give examples of anomaly detection applications.
- Fraud detection in banking
- Network intrusion detection
- Fault detection in machines
- Medical abnormality detection
50. What are the main types of clustering?
- Partition based clustering
- Densitybased clustering
- Distribution (model)based clustering
- Hierarchical clustering
51. What is partition based clustering?
Partition based clustering divides data into a fixed number of groups called clusters. Each data item belongs to only one cluster.
52. Give an example of partition based clustering.
KMeans clustering
53. What are the advantages of partition based clustering?
- Easy to understand and use
- Works fast for large data
- Simple calculations
- Good when clusters are clearly separated
54. What are the disadvantages of partitionbased clustering?
- Number of clusters must be chosen first
- Results can change with different starting points
- Does not work well with noisy data
- Cannot find complex shapes of clusters
55. What is density based clustering?
Density based clustering makes clusters where data points are close together and marks faraway points as noise.
56. Name one density based clustering method.
DBSCAN
57. What are the advantages of density based clustering?
- Finds clusters of any shape
- No need to decide number of clusters first
- Can find noise and outliers
- Works well with real world data
58. What are the disadvantages of density based clustering?
- Hard to choose correct parameters
- Does not work well if cluster densities are different
- Slow for very large data
- Not good for highdimensional data
59. What is distribution based clustering?
This method assumes that data comes from different probability models. Each model represents a cluster.
60. Give an example of distribution based clustering.
Gaussian Mixture Model (GMM) is an example.
61. What are the advantages of distribution based clustering?
- Can handle overlapping clusters
- Gives probability of belonging to a cluster
- More flexible than KMeans
- Better for complex data
62. What are the disadvantages of distributionbased clustering?
- Needs more calculations
- Assumes data follows a specific pattern
- Slower than KMeans
- Hard to use for very large data
63. What is hierarchical clustering?
Hierarchical clustering creates a treelike structure of clusters by joining or splitting clusters step by step.
64. What are the advantages of hierarchical clustering?
- No need to decide number of clusters in advance
- Easy to understand using diagrams
- Shows relationship between clusters
- Good for small datasets
65. What are the disadvantages of hierarchical clustering?
- Very slow for large datasets
- Mistakes cannot be corrected
- Sensitive to noise
- Uses more memory
66. Which clustering method is best for finding noise?
Density based clustering
67. Which clustering method needs the number of clusters beforehand?
Partition based and distribution based clustering
68. Which clustering method uses a tree diagram?
Hierarchical clustering
69. Which clustering method is best for large data?
Partition based clustering is best for large data.
70. What is KMeans clustering?
KMeans clustering is an unsupervised learning algorithm that divides data into K groups (clusters). Each data point belongs to the cluster with the nearest mean (centroid).
72. Why is it called KMeans?
It is called KMeans because:
- K represents the number of clusters
- Means refers to the average (mean) value of data points in each cluster
73. Is KMeans supervised or unsupervised?
Unsupervised learning algorithm because it works on unlabeled data.
74. What are the steps of the KMeans clustering algorithm?
i. Collect the data
Gather the dataset to be clustered.
ii. Preprocess the data
Clean the data by removing missing values and scaling features.
iii. Choose the number of clusters (K)
Decide how many clusters are needed.
iv. Initialize centroids
Select K points randomly as the starting centroids.
v. Assign data points to clusters
Assign each data point to the nearest centroid.
vi. Update centroids
Calculate the new centroid by taking the mean of all points in a cluster.
vii. Repeat the process
Repeat assignment and update steps until centroids do not change.
viii. Evaluate and visualize results
Check cluster quality and plot the clusters.
75. What are the advantages of KMeans clustering?
- Easy to understand and implement
- Fast and efficient for large datasets
- Simple mathematical calculations
- Works well when clusters are clearly separated
76. What are the disadvantages of KMeans clustering?
- Number of clusters (K) must be chosen in advance
- Sensitive to initial centroid selection
- Affected by noise and outliers
- Does not work well with non spherical clusters
77. What are the applications of KMeans clustering?
- Customer segmentation in marketing
- Image compression
- Document and text clustering
- Sales and market analysis
- Grouping students based on performance
78. How does KMeans assign a data point to a cluster?
KMeans assigns a data point to the cluster whose centroid is closest to it, usually using Euclidean distance.
79. What happens if the value of K is chosen incorrectly?
- If K is too small, different groups may be merged.
- If K is too large, similar data points may be split into many clusters.
80. When should KMeans not be used?
KMeans should not be used when:
- Data contains many outliers
- Clusters have complex shapes
- Number of clusters is unknown
