联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Algorithm 算法作业Algorithm 算法作业

日期:2020-04-11 11:04

Quiz 6

Started: Apr 9 at 4:22am

Quiz Instructions

Quiz 6: K353, Spring 2020

Instructions:

? You must submit this assignment by 11:30 pm, Monday, April 13, 2020

? Late submissions receive zero credit.

? There is no time limit with this quiz. You can come back to it later and pick up where you

left off.

? You must submit your own assignment.

? Your assignment is submitted only once you click the "submit" button!

? Do NOT forget to click submit.

? Once you click submit, you will NOT be allowed to submit a different set of answers – you

will only be able to submit once!

? There is no partial credit.

? You are expected to use R to answer all questions.

? If you answered Questions 2-8 but Question 9 (which asks for the R code you used to

answer Question 2-8) is blank, your quiz score will result in, at best, a score of zero.

? If the R code you provided in Question 9 does not match your answers for the rest of the

questions, your quiz score will result in, at best, a score of zero.

5 pts

HTML Editor?

Question 1

Accuracy is a numerical measure that is used to evaluate classification

models. Explain how accuracy is calculated. Also, explain why accuracy

may not the best metric to evaluate classification models.

A company that manufactures riding mowers wants to identify the best

sales prospects for an intensive sales campaign. In particular, the

manufacturer is interested in classifying households as prospective owners

or nonowners on the basis of Income (in $1000s) and Lot Size (in 1000 ft2).

The marketing expert looked at a random sample of 24 households, given

in the file RidingMowers.csv (under Datasets).

5 pts

HTML Editor?

Question 2

Make sure to include the following lines of code in your R script to load and

modify the dataset:

mower_data <- read.csv('RidingMowers.csv', header = T, as.is = T)

mower_data$OwnershipNum <- mower_data$Ownership

mower_data$OwnershipNum[mower_data$Ownership == "owner"] <-

1

mower_data$OwnershipNum[mower_data$Ownership == "nonowner"]

<- 0

mower_data$OwnershipNum <- as.numeric

(mower_data$OwnershipNum)

In your own words, explain what the above chunk of code does line by line.

Question 3 5 pts

After running the chunk of code in Q2, use all the data (do NOT partition

data) to fit a logistic regression for ownership (OwnershipNum) on two

predictors, Income and Lot size. Based on logistic regression output,

provide the coefficient value for the predictor Lot size (for the equation

where the right-hand side is log of odds). Round your answer to two

decimals.

Question 4 5 pts

Use the logistic regression model in Q3 and cutoff value 0.3 to classify

customers in the dataset as owners and nonowners. Among nonowners,

what is the percentage of households classified correctly? Round your

answer to two decimals.

Question 5 3 pts

Based on the model fitted in Q3, what is the probability that a household

with a $69K income and a lot size of 15,000 ft2 is an owner? Round your

answer to two decimals.

Question 6 2 pts

Assume that it is more important to detect customers who are owners than

detecting customers who are nonowners. Provide a numeric measure for

how good your model in Q3 is at finding the customers who are owners,

assuming that the cutoff is 0.5. Round your answer to two decimals.

Question 7 2 pts

Assume that it is more important to detect customers who are owners than

detecting customers who are nonowners. Provide a numeric measure for

how good your model in Q3 is at finding the customers who are owners,

assuming that the cutoff is 0.3. Round your answer to two decimals.

Question 8 3 pts

Use all the data (do NOT partition data) to fit a logistic regression for

ownership (OwnershipNum) on three predictors, Income, Lot size and

interaction between Income and Lot size. Use this logistic regression model

and cutoff value 0.5 to classify customers in the dataset as owners and

nonowners. What is the accuracy of this model? Round your answer to two

decimals.

0 pts

HTML Editor?

Question 9

Paste the R code you used to answer the above questions.

No new data to save. Last checked at 4:28pm

Submit Quiz


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp