Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Homework 5

  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

Financial Accounting and Reporting a Global Perspective

Authors: Michel Lebas, Herve Stolowy, Yuan Ding

4th edition

978-1408076866

Students also viewed these Mathematics questions