Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Follow the steps to produce predictions (50 points) Introduction: The iris data set gives the measurements in centimeters of the variables sepal length and width

  1. Follow the steps to produce predictions (50 points)

Introduction:

The iris data set gives the

measurements in centimeters of the variables sepal length and

width and petal length and width, respectively, for 50 flowers

from each of 3 species of iris.The species are _Iris setosa_,

_versicolor_, and _virginica_.

In R:

>library(class)

>tidx <- sample(nrow(iris),round(.6*nrow(iris)))

>train <- iris[tidx,-5]

>test <- iris[-tidx,-5]

>cl <- iris[tidx,5]

>orig <- iris[-tidx,5]

>pred <- knn(train,test,cl,k=3,prob=TRUE)

# Use the table below to build your confusion matrix

table(orig,pred)

2.Answer the following questions (50 points)

2.1 What method was used to provide the predictions?

2.2What is the role of the variable cl?

2.3Use the table generated above to produce your measures of performance and provide them below.

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

Understanding Analysis

Authors: Stephen Abbott

1st Edition

6610189684, 9786610189687

More Books

Students also viewed these Mathematics questions

Question

What does the slope in a simple linear regression model measure?

Answered: 1 week ago