全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
7155 1
2014-09-01
# use half the iris data
ir <- rbind(iris3[,,1],iris3[,,2],iris3[,,3])
targets <- class.ind( c(rep("s", 50), rep("c", 50), rep("v", 50)) )
samp <- c(sample(1:50,25), sample(51:100,25), sample(101:150,25))
ir1 <- nnet(ir[samp,], targets[samp,], size = 2, rang = 0.1,
            decay = 5e-4, maxit = 200)



没有targets <- class.ind( c(rep("s", 50), rep("c", 50), rep("v", 50)) )的话行不行?

二维码

扫码加我 拉你入群

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

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

全部回复
2014-12-11 23:48:53

不可以没有,你看下面这个

  

nnet(x, y, weights, size, Wts, mask,     linout = FALSE, entropy = FALSE, softmax = FALSE,     censored = FALSE, skip = FALSE, rang = 0.7, decay = 0,     maxit = 100, Hess = FALSE, trace = TRUE, MaxNWts = 1000,     abstol = 1.0e-4, reltol = 1.0e-8, ...)

  x    matrix or data frame of x values for examples.
y  matrix or data frame of target values for examples.

二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群