Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Page of 4 ZOOM+ Questions L. As part of this question, we will write a simple 2-Class classiier. The problem statement is as follows: Given

image text in transcribedimage text in transcribed

Page of 4 ZOOM+ Questions L. As part of this question, we will write a simple 2-Class classiier. The problem statement is as follows: Given a se of psinls in a 2-D plane, partition the sel into Iwo and relwrm the centroid in ewch purdin The points may represenl some features of e dala (e.g, hcighl and weight o entities, color and valuc of geods the scmantics of those featares and their relationships are not considered here. We will follow a simple unsupervised classification mechanism as follows. S1. Pick any two points pi andpz from the given set. S2. Partition the set into two classes A and B, where A contains all the points tht are closer top than p2: and B contains the rest of the points. S3. Compate the centroid in cach partition. Consider them as the ncw values for pi and p2, Notc that, at this point Pi and p may not comespond to any point in the given set S4. Iterate the sleps (S2) and(S3) for k times. After ktimes, return p and p2. In summary, we start with two distinct points and partition the input set of points; find the centroid in cach partition and repeat the process of partitioning usine the centroids. The number of repetition depends on the value of k (which will he pre-specifiod). In the above, we will use Euclidean distance to compute the distance between points, For the computa- tion of centroid, we will use the following two strategies: Given points in aset y,a the ventroid is Strategy2 median point if the points are sorted hased on their distance from 0,0) The set of points will be presented as a list ol pairs, where a pair represents the coordinales of a poinL For exampe (define ptlist ((1 0) (2 3) 4 10) (2 1) 6 5) 15 ) (3 1) (20 (25 3) (30 0) 22 101 21 10) (20 5) (27 2) (28 9)) You will implement the following functions to realize the above classification stralegy (the functions illastrates one way to fianctionally decompose the problem) (a) pt comparator: takes as input two points and P2. and eturn true if Pl is closer to (0,0) (b) ptsort: takes as input a list of poinis and a comparalor function (over poinls) and relurns a list (c) goetcanl: takes as input a list of points and returns a point as the centruid of the set as per (d) getcen2: takes as input a list of points and retarns a point as the centroid of the sct as par than p2 of points sorled as per the comparator function. stralegy 1 strategy 2 Page of 4 1. As part of this question, we will write a simple 2-Class classifier. The problem statement is as follows: Given a set of points in a 2-D plane, partition the set into two and return the centroid in each partition. The points may represent some features of the data (e.g., height and weight of entities, color and value of goods)-the semantics of those features and their relationships are not considered here. We will follow a simple unsupervised classification mechanism as follows. S1. Pick any two points pi and p from the given set S2. Partition the set into two classes A and B, where A contains all the points that are closer to pi than p2; and B contains the rest of the points. S3. Compute the centroid in each partition. Consider them as the new values for pi and p2. Note that, at this point pi and p may not correspond to any point in the given set. S4. Iterate the steps (S2) and (S3 for k times. After k times, return pi and p In summary, we start with two distinct points and partition the input set of points; find the centroid in each partition and repeat the process of partitioning using the centroids. The number of repetition depends on the value of k (which will be pre-specified). In the above, we will use Euclidean distance to compute the distance between points. For the computa- tion of centroid, we will use the following two strategies: Given n points in a set (i,y) E[1, n the centroid is Strategy2 median point if the points are sorted based on their distance from (0, 0) The set of points will be presented as a list of pairs, where a pair represents the coordinates of a point. For example: (define ptlist'((1 0) (2 3) (4 10) (21) (6 5) (5 4) (3 4) (201) (25 3) (30 0) (22 10) (21 10) (20 5)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

International Baccalaureate Computer Science HL And SL Option A Databases Part I Basic Concepts

Authors: H Sarah Shakibi PhD

1st Edition

1542457084, 978-1542457088

More Books

Students also viewed these Databases questions

Question

design a simple disciplinary and grievance procedure.

Answered: 1 week ago