使用所有属性运行神经网络时出现问题

时间:2018-08-10 10:03:12

标签: r neural-network

我正在尝试对具有81个变量(包括因变量“ AttritionYes”)的数据集运行神经网络,但它抛出错误,表明没有数据参数。下面是带有错误的代码。我使用公式不正确吗?

> nn1 <- neuralnet(formula = AttritionYes ~ . , data = df.data2[,1:81],
+                  hidden = 9,
+                  err.fct = "sse",
+                  linear.output = FALSE,
+                  lifesign = "full",
+                  lifesign.step = 10,
+                  threshold = 0.1,
+                  stepmax = 2000
+                  ##startweights = startweightsObj
+ )
Error in terms.formula(formula) : '.' in formula and no 'data' argument

1 个答案:

答案 0 :(得分:0)

似乎declare @t table (recno int,part varchar(50),ipart varchar(50),remark int) insert into @t values (2 ,'0343432','9141212' ,7), (3 ,'73442' ,'000832' ,8), (4 ,'911212' ,'28832' ,9), (5 ,'009832' ,'00988' ,10), (6 ,'57292' ,'11234' ,11), (7 ,'9141212','0343432' ,2), (8 ,'000832' ,'73442' ,3), (9 ,'28832' ,'911212' ,4), (10,'00988' ,'009832' ,5), (11,'11234' ,'57292' ,6) 无法识别这种形式的公式,即它无法将点扩展到数据集中的所有变量。

尝试

neuralnet