Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Any help on the program would be great. I trying my best to understand it, but I am confused on what it is asking. Once

Any help on the program would be great. I trying my best to understand it, but I am confused on what it is asking. Once again, anything would be a big help.

image text in transcribed

image text in transcribed

The learning will be done by remembering training examples stored in a comma-separated file. The training examples include different measurements which collectively are called attributes and a class label for different instances, including: 1. sepal length in cm 2. sepal width in cm 3. petal length in cm 4. petal width in cm 5. class: - Iris Setosa -Iris Versicolour -Iris Virginica To see how well the program "learned", you will then load a file containing testing examples, which will include the same type of information, but for different instances. For each test instance, you will apply the Nearest Neighbor algorithm to classify the instance. This algorithm works by choosing a class label of the "closest" training example, where "closest" means shortest distance. The distance is computed using the following formula dist(x,y) = (sh-sl)' + (swr-sw'y)' + (plx-ply)' + (pwr-pw) where x, y are two instances (i.e. a training or a testing example), slx, sly are their sepal lengths, SWx, sWy are their sepal widths, plx ply are their petal lengths, and pw pwy are their petal widths. After you finish classifying each testing instance, you will then need to compare it to the "true" label that is specified for each example and compute the accuracy. Accuracy is measured as the number of correctly classified instances divided by the number of total testing instances The learning will be done by remembering training examples stored in a comma-separated file. The training examples include different measurements which collectively are called attributes and a class label for different instances, including: 1. sepal length in cm 2. sepal width in cm 3. petal length in cm 4. petal width in cm 5. class: - Iris Setosa -Iris Versicolour -Iris Virginica To see how well the program "learned", you will then load a file containing testing examples, which will include the same type of information, but for different instances. For each test instance, you will apply the Nearest Neighbor algorithm to classify the instance. This algorithm works by choosing a class label of the "closest" training example, where "closest" means shortest distance. The distance is computed using the following formula dist(x,y) = (sh-sl)' + (swr-sw'y)' + (plx-ply)' + (pwr-pw) where x, y are two instances (i.e. a training or a testing example), slx, sly are their sepal lengths, SWx, sWy are their sepal widths, plx ply are their petal lengths, and pw pwy are their petal widths. After you finish classifying each testing instance, you will then need to compare it to the "true" label that is specified for each example and compute the accuracy. Accuracy is measured as the number of correctly classified instances divided by the number of total testing instances

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