楼主: 夜神月是神
211 1

[问答] 老师布置作业求大神解答 [推广有奖]

  • 0关注
  • 0粉丝

学前班

40%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
20 点
帖子
1
精华
0
在线时间
0 小时
注册时间
2015-5-7
最后登录
2015-5-7

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
11. In this problem, you will develop a model to predict whether a given
car gets high or low gas mileage based on the Auto data set.
(a) Create a binary variable, mpg01, that contains a 1 if mpg contains
a value above its median, and a 0 if mpg contains a value below
its median. You can compute the median using the median()
function. Note you may find it helpful to use the data.frame()
function to create a single data set containing both mpg01 and
the other Auto variables.
172 4. Classification
(b) Explore the data graphically in order to investigate the association between mpg01 and the other features. Which of the other
features seem most likely to be useful in predicting mpg01? Scatterplots and boxplots may be useful tools to answer this question. Describe your findings.
(c) Split the data into a training set and a test set.
(d) Perform LDA on the training data in order to predict mpg01
using the variables that seemed most associated with mpg01 in
(b). What is the test error of the model obtained?
(e) Perform QDA on the training data in order to predict mpg01
using the variables that seemed most associated with mpg01 in
(b). What is the test error of the model obtained?
(f) Perform logistic regression on the training data in order to predict mpg01 using the variables that seemed most associated with
mpg01 in (b). What is the test error of the model obtained?
(g) Perform KNN on the training data, with several values of K, in
order to predict mpg01. Use only the variables that seemed most
associated with mpg01 in (b). What test errors do you obtain?
Which value of K seems to perform the best on this data set?
在这个问题中,您将开发一个模型来预测是否一个给定的
汽车得到高或低油耗根据汽车数据集。
(一)创建一个二进制变量,mpg01,包含一个1英里/加仑是否包含
价值高于中位数,如果mpg包含一个值低于0
它的值。您可以使用中值计算中位数()
功能。请注意您可能会发现它有助于使用data.frame()
函数来创建一个包含mpg01和数据集
其他汽车变量。
172 4。分类
(b)探索数据图形化,以调查mpg01和其他特性之间的关系。而其他的
功能似乎最有可能是有用的在预测mpg01吗?散点图和箱线图可能有用的工具来回答这个问题。描述你的结果。
(c)将数据分为训练集和测试集。
(d)对训练数据以执行LDA预测mpg01
使用的变量似乎大多数与mpg01有关
(b)。获得的测试误差的模型是什么?
(e)对训练数据以执行QDA预测mpg01
使用的变量似乎大多数与mpg01有关
(b)。获得的测试误差的模型是什么?
(f)对训练数据以执行逻辑回归预测mpg01使用的变量似乎是最相关的
(b)mpg01。获得的测试误差的模型是什么?
(g)对训练数据执行法,与几个K值,
为了预测mpg01。只使用的变量似乎最大
在(b)与mpg01。你获得什么测试错误?
的K值似乎对这个数据集执行最好的吗?

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Association scatterplot predicting regression Variables median function develop helpful problem

沙发
nuomin 发表于 2015-5-7 20:10:54 |只看作者 |坛友微信交流群
翻译是谷歌翻译的?

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-14 17:37