Exercises ML PDF
Exercises ML PDF
2. Consider a dataset that contains two variables: height (cm) & weight (kg). Each point is classified
as normal or underweight. Based on the below data, you need to classify the following set (57 kg,
170 cm) as normal or underweight using the KNN algorithm. To find the nearest neighbors, we
will calculate the Euclidean distance. And k=3
Given two inputs– Young, and Low–we want to compute the probability of these people buying a car by using
Naive Bayes.
1|4
4. Suppose we have several objects (4 types of medicines) and each object have two attributes of
features (pH and weight index). Each medicine represents one point with two attributes (x,y) that
we can represented it as coordinate in an attribute space shown in the figure below
Use Euclidean distance in your distance computations, assume that k=2 and initial cluster are medicine
c1=(1,1) and c2=(2,1) . Show two iteration of k-means clustering algorithm for these data points. Give cluster
means and cluster contents after each iteration
5- Suppose we have height, weight and T-shirt size of some customers and we need to predict the T-shirt size of a new
customer given only height and weight information we have. Data including height, weight and T-shirt size information
is shown below –
New customer named 'Monica' has height 161cm and weight 61kg.
Let k be 5.
2|4
Multiple Choice Questions
3|4
6. What is unsupervised learning?
a. labeled of groups may be known b. Features of group are known
c. Neither feature nor labeled of groups is known d. None of the mentioned
7. What kind of distance metric(s) is suitable for binary variables to find the closest neighbors?
a. Euclidean distance. b. Manhattan distance.
c. Minkowski distance. d. Hamming distance.
8. You have a dataset with different names of flowers containing their petal lengths and color. Your model
has to predict the name of flower for given petal lengths and color. This is a------
a. Regression task b. Classification task c. Clustering task d. None of the mentioned
10. The algorithm, that improves upon itself. It typically learns by trial and error to achieve a clear objective.
a. Deep learning b. Reinforcement c. Regression d. Similarity distance
4|4