Question: Task 3 ( 5 0 marks ) A fundamental problem in machine learning and data analytics is to partition or classify objects in a 'natural'
Task marks
A fundamental problem in machine learning and data analytics is to partition or classify
objects in a 'natural' way based on their 'distances' to each other. In this question, you
are given an integer and points in a horizontal line. We want to
partition the points into groups so that intuitively within each group the points are
'close' together. The following is an example of what may be a good way of partitioning
the following points into groups, and what may be a bad way:
More precisely, each point is a number on the xaxis. To measure how 'good' a
partitioning is we define the error of a group of points dots, to be
cdots
where is the average of the points. Our
objective is to find the optimal way of partitioning the points into groups so that the
sum of errors of all groups is minimized.
For example, the 'bad' way of partitioning for the above example gives an error of:
Group : average error
Group : average
error
Group : average error
Total error
We divide the points in such a way that only consecutive points along the line may
fall into the same group.
Design an efficient algorithm for this problem. You should: the following is described
in terms of the design of a dynamic programming algorithm, since you almost certainly
should use it
In plain English or using some mathematical notation, give a recursive
formulation of the problem. Hint: one possible approach is to define
to be the error of the optimal partition of the first i points dots, into
groups, where and The value of can be found
recursively: consider all possible locations where the last group can
begin.
Write a program in of the algorithm that is based on this formulation
Pseudocode may be accepted however some points will be lost
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
