d=readARFF("CM1.arff")
dput( head( d, 50 ) )
structure(list(LOC_BLANK = c(6, 15, 27, 1, 7, 51, 3, 13, 22,
16, 4, 23, 23, 40, 23, 8, 2, 19, 0, 7, 6, 134, 9, 164, 27, 4,
5, 7, 16, 15, 19, 19, 15, 13, 14, 12, 23, 155, 42, 30, 9, 26,
40, 7, 7, 93, 9, 3, 12, 31), BRANCH_COUNT = c(9, 7, 9, 1, 3,
25, 5, 9, 29, 9, 3, 13, 13, 9, 9, 3, 1, 3, 1, 6, 7, 60, 8, 110,
24, 1, 5, 9, 5, 7, 5, 7, 11, 3, 9, 9, 9, 71, 11, 19, 3, 17, 11,
3, 7, 25, 5, 1, 7, 11), CALL_PAIRS = c(2, 3, 1, 2, 2, 13, 2,
5, 0, 2, 0, 0, 0, 4, 6, 1, 1, 1, 1, 0, 0, 9, 2, 26, 11, 1, 1,
3, 7, 3, 4, 5, 4, 1, 3, 4, 5, 5, 10, 5, 2, 4, 12, 2, 2, 10, 3,
1, 2, 5), LOC_CODE_AND_COMMENT = c(1, 1, 4, 0, 0, 0, 0, 12, 8,
11, 2, 10, 10, 2, 3, 6, 1, 2, 1, 1, 6, 63, 4, 37, 3, 0, 0, 4,
2, 3, 2, 5, 5, 3, 2, 2, 10, 14, 5, 6, 0, 5, 3, 0, 0, 11, 2, 0,
2, 7), LOC_COMMENTS = c(0, 19, 22, 0, 0, 14, 0, 16, 35, 28, 4,
17, 17, 15, 20, 5, 1, 0, 1, 0, 0, 31, 5, 191, 48, 10, 0, 5, 24,
8, 16, 10, 19, 18, 20, 12, 9, 170, 44, 45, 7, 32, 47, 6, 8, 57,
2, 3, 2, 30), CONDITION_COUNT = c(16, 12, 16, 0, 4, 48, 8, 16,
44, 12, 4, 24, 24, 16, 16, 4, 0, 4, 0, 0, 10, 38, 8, 128, 34,
0, 8, 14, 8, 12, 8, 12, 20, 4, 16, 16, 16, 122, 20, 36, 4, 28,
20, 0, 12, 48, 8, 0, 12, 20), CYCLOMATIC_COMPLEXITY = c(5, 4,
5, 1, 2, 13, 3, 5, 15, 5, 2, 7, 7, 5, 5, 2, 1, 2, 1, 5, 4, 41,
5, 70, 13, 1, 3, 5, 3, 4, 3, 4, 6, 2, 5, 5, 5, 37, 6, 10, 2,
9, 6, 2, 4, 13, 3, 1, 4, 6), CYCLOMATIC_DENSITY = c(0.2, 0.13,
0.15, 0.14, 0.17, 0.12, 0.2, 0.14, 0.28, 0.11, 0.17, 0.21, 0.21,
0.15, 0.19, 0.11, 0.14, 0.06, 0.14, 0.12, 0.15, 0.17, 0.28, 0.18,
0.16, 0.03, 0.15, 0.16, 0.18, 0.25, 0.11, 0.15, 0.18, 0.1, 0.19,
0.13, 0.12, 0.18, 0.16, 0.13, 0.13, 0.13, 0.14, 0.25, 0.16, 0.08,
0.16, 0.13, 0.2, 0.15), DECISION_COUNT = c(8, 6, 8, 0, 2, 24,
4, 8, 16, 4, 2, 12, 12, 8, 8, 2, 0, 2, 0, 0, 4, 16, 4, 54, 14,
0, 4, 6, 4, 6, 4, 6, 10, 2, 8, 8, 8, 58, 10, 18, 2, 12, 10, 0,
6, 24, 4, 0, 6, 10), DECISION_DENSITY = c(2, 2, 2, NA, 2, 2,
2, 2, 2.75, 3, 2, 2, 2, 2, 2, 2, NA, 2, NA, NA, 2.5, 2.38, 2,
2.37, 2.43, NA, 2, 2.33, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2.1, 2, 2,
2, 2.33, 2, NA, 2, 2, 2, NA, 2, 2), DESIGN_COMPLEXITY = c(3,
2, 3, 1, 2, 11, 3, 5, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1,
23, 3, 46, 10, 1, 3, 3, 3, 4, 3, 4, 4, 2, 3, 5, 5, 26, 6, 9,
2, 6, 5, 1, 1, 12, 3, 1, 4, 5), DESIGN_DENSITY = c(0.6, 0.5,
0.6, 1, 1, 0.85, 1, 1, 0.07, 0.2, 0.5, 0.14, 0.14, 0.4, 0.4,
0.5, 1, 1, 1, 0.2, 0.25, 0.56, 0.6, 0.66, 0.77, 1, 1, 0.6, 1,
1, 1, 1, 0.67, 1, 0.6, 1, 1, 0.7, 1, 0.9, 1, 0.67, 0.83, 0.5,
0.25, 0.92, 1, 1, 1, 0.83), EDGE_COUNT = c(17, 17, 18, 3, 6,
96, 12, 21, 45, 21, 6, 27, 27, 21, 23, 7, 2, 23, 2, 12, 13, 118,
14, 241, 53, 2, 10, 20, 15, 15, 14, 15, 23, 6, 21, 22, 21, 148,
30, 48, 6, 39, 40, 8, 16, 69, 11, 7, 14, 26), ESSENTIAL_COMPLEXITY = c(1,
1, 1, 1, 1, 1, 1, 5, 3, 5, 1, 5, 5, 1, 1, 1, 1, 1, 1, 1, 4, 6,
1, 27, 7, 1, 1, 3, 1, 1, 1, 4, 1, 1, 1, 1, 5, 21, 1, 8, 1, 4,
1, 1, 1, 1, 1, 1, 1, 1), ESSENTIAL_DENSITY = c(0, 0, 0, 0, 0,
0, 0, 1, 0.14, 1, 0, 0.67, 0.67, 0, 0, 0, 0, 0, 0, 0, 1, 0.13,
0, 0.38, 0.5, 0, 0, 0.5, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0.56, 0,
0.78, 0, 0.38, 0, 0, 0, 0, 0, 0, 0, 0), LOC_EXECUTABLE = c(24,
31, 29, 7, 12, 106, 15, 25, 46, 34, 10, 23, 23, 31, 24, 13, 6,
33, 6, 41, 21, 177, 14, 361, 76, 31, 20, 27, 15, 13, 25, 22,
28, 18, 24, 38, 31, 196, 32, 71, 15, 62, 41, 8, 25, 143, 17,
8, 18, 33), PARAMETER_COUNT = c(3, 1, 0, 1, 2, 2, 1, 4, 0, 2,
1, 3, 3, 0, 0, 1, 1, 0, 1, 1, 1, 5, 0, 1, 1, 0, 1, 0, 1, 0, 1,
1, 2, 2, 1, 1, 1, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 1, 0),
GLOBAL_DATA_COMPLEXITY = c(0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0), GLOBAL_DATA_DENSITY = c(0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0), HALSTEAD_CONTENT = c(32.54, 38.55, 52.03, 17.43, 14.62,
101.31, 8.17, 38.51, 61.1, 41.24, 15.9, 27.4, 17.45, 47.41, 43.1,
29.61, 13.88, 64.01, 13.88, 36.35, 21.34, 101.81, 12.36, 157.03,
60.5, 116.21, 34.17, 24.71, 36.19, 26.75, 48.49, 28.43, 30.61,
25.62, 27.08, 54.44, 54.55, 127.7, 53.31, 46.15, 27.05, 97.49,
61.64, 28.75, 31.67, 175.18, 36.74, 24.41, 54.3, 53.63),
HALSTEAD_DIFFICULTY = c(9.5,
21.52, 12.33, 2, 6.43, 27.04, 18, 14.25, 22.3, 20.76, 9, 28.12,
27.22, 27.5, 15.2, 9.15, 4, 11.65, 4, 21.98, 24.44, 54.82, 15,
97.73, 32.21, 22.83, 10.29, 21.86, 7.18, 11.03, 14.11, 13.42,
23.1, 24.42, 39.72, 19.25, 14.84, 71.54, 12.89, 27.11, 14.25,
20.91, 16.96, 5.5, 15, 28.52, 14.57, 8.36, 7.89, 18.46), HALSTEAD_EFFORT
c(2936.77,
17846.19, 7914.68, 69.74, 604.36, 74089.87, 2648.68, 7820.87,
30377.95, 17773.08, 1287.55, 21659.58, 12929.85, 35852.6, 9958,
2480.95, 222.03, 8684.99, 222.03, 17553.08, 12748.97, 305928.62,
2781.99, 1499684.32, 62767.66, 60566.12, 3620.93, 11802.86, 1867.89,
3253.68, 9649.29, 5120.93, 16332.07, 15282.02, 42716.37, 20172.82,
12009.6, 653537.1, 8852.8, 33930.43, 5493.37, 42621.97, 17733.62,
869.68, 7125, 142535.33, 7799.92, 1704.86, 3382.91, 18269.63),
HALSTEAD_ERROR_EST = c(0.1, 0.28, 0.21, 0.01, 0.03, 0.91,
0.05, 0.18, 0.45, 0.29, 0.05, 0.26, 0.16, 0.43, 0.22, 0.09,
0.02, 0.25, 0.02, 0.27, 0.17, 1.86, 0.06, 5.12, 0.65, 0.88,
0.12, 0.18, 0.09, 0.1, 0.23, 0.13, 0.24, 0.21, 0.36, 0.35,
0.27, 3.05, 0.23, 0.42, 0.13, 0.68, 0.35, 0.05, 0.16, 1.67,
0.18, 0.07, 0.14, 0.33), HALSTEAD_LENGTH = c(63, 141, 111,
11, 23, 421, 36, 107, 239, 155, 35, 157, 105, 231, 120, 57,
15, 135, 15, 157, 98, 767, 41, 1844, 298, 461, 71, 108, 52,
59, 120, 75, 128, 122, 197, 176, 140, 1177, 123, 211, 74,
314, 177, 36, 95, 695, 102, 51, 80, 172), HALSTEAD_LEVEL = c(0.11,
0.05, 0.08, 0.5, 0.16, 0.04, 0.06, 0.07, 0.04, 0.05, 0.11,
0.04, 0.04, 0.04, 0.07, 0.11, 0.25, 0.09, 0.25, 0.05, 0.04,
0.02, 0.07, 0.01, 0.03, 0.04, 0.1, 0.05, 0.14, 0.09, 0.07,
0.07, 0.04, 0.04, 0.03, 0.05, 0.07, 0.01, 0.08, 0.04, 0.07,
0.05, 0.06, 0.18, 0.07, 0.04, 0.07, 0.12, 0.13, 0.05),
HALSTEAD_PROG_TIME = c(163.15,
991.46, 439.7, 3.87, 33.58, 4116.1, 147.15, 434.49, 1687.66,
987.39, 71.53, 1203.31, 718.32, 1991.81, 553.22, 137.83,
12.33, 482.5, 12.33, 975.17, 708.28, 16996.03, 154.56, 83315.8,
3487.09, 3364.78, 201.16, 655.71, 103.77, 180.76, 536.07,
284.5, 907.34, 849, 2373.13, 1120.71, 667.2, 36307.62, 491.82,
1885.02, 305.19, 2367.89, 985.2, 48.32, 395.83, 7918.63,
433.33, 94.71, 187.94, 1014.98), HALSTEAD_VOLUME = c(309.13,
829.45, 641.73, 34.87, 94.01, 2739.78, 147.15, 548.83, 1362.41,
856.15, 143.06, 770.38, 474.97, 1303.73, 655.13, 271.03,
55.51, 745.68, 55.51, 798.73, 521.54, 5580.79, 185.47, 15345.64,
1948.67, 2653, 351.75, 540, 260, 295, 684.05, 381.56, 707.02,
625.77, 1075.51, 1047.94, 809.39, 9135.35, 686.95, 1251.39,
385.5, 2038.44, 1045.52, 158.12, 475, 4996.93, 535.29, 204,
428.6, 989.84), MAINTENANCE_SEVERITY = c(0.2, 0.25, 0.2,
1, 0.5, 0.08, 0.33, 1, 0.2, 1, 0.5, 0.71, 0.71, 0.2, 0.2,
0.5, 1, 0.5, 1, 0.2, 1, 0.15, 0.2, 0.39, 0.54, 1, 0.33, 0.6,
0.33, 0.25, 0.33, 1, 0.17, 0.5, 0.2, 0.2, 1, 0.57, 0.17,
0.8, 0.5, 0.44, 0.17, 0.5, 0.25, 0.08, 0.33, 1, 0.25, 0.17
), MODIFIED_CONDITION_COUNT = c(4, 3, 4, 0, 1, 12, 2, 4,
14, 4, 1, 6, 6, 4, 4, 1, 0, 1, 0, 0, 3, 11, 2, 37, 10, 0,
2, 4, 2, 3, 2, 3, 5, 1, 4, 4, 4, 32, 5, 9, 1, 8, 5, 0, 3,
12, 2, 0, 3, 5), MULTIPLE_CONDITION_COUNT = c(8, 6, 8, 0,
2, 24, 4, 8, 22, 6, 2, 12, 12, 8, 8, 2, 0, 2, 0, 0, 5, 19,
4, 66, 19, 0, 4, 7, 4, 6, 4, 6, 10, 2, 8, 8, 8, 61, 10, 18,
2, 14, 10, 0, 6, 24, 4, 0, 6, 10), NODE_COUNT = c(14, 15,
15, 4, 6, 85, 11, 18, 32, 18, 6, 22, 22, 18, 20, 7, 3, 23,
3, 9, 11, 79, 11, 173, 42, 3, 9, 17, 14, 13, 13, 13, 19,
6, 18, 19, 18, 113, 26, 40, 6, 32, 36, 8, 14, 58, 10, 8,
12, 22), NORMALIZED_CYLOMATIC_COMPLEXITY = c(0.16, 0.06,
0.06, 0.11, 0.1, 0.08, 0.16, 0.07, 0.13, 0.06, 0.1, 0.09,
0.09, 0.06, 0.07, 0.06, 0.09, 0.04, 0.11, 0.1, 0.12, 0.1,
0.15, 0.09, 0.08, 0.02, 0.12, 0.11, 0.05, 0.1, 0.04, 0.07,
0.08, 0.04, 0.07, 0.07, 0.07, 0.07, 0.05, 0.07, 0.06, 0.07,
0.05, 0.09, 0.1, 0.04, 0.1, 0.03, 0.11, 0.06), NUM_OPERANDS = c(19,
51, 37, 5, 9, 192, 15, 38, 110, 59, 16, 43, 35, 70, 40, 17,
5, 66, 5, 71, 40, 268, 16, 711, 102, 144, 25, 34, 21, 25,
49, 34, 55, 58, 87, 70, 61, 454, 47, 73, 27, 115, 63, 10,
30, 290, 36, 13, 34, 68), NUM_OPERATORS = c(44, 90, 74, 6,
14, 229, 21, 69, 129, 96, 19, 114, 70, 161, 80, 40, 10, 69,
10, 86, 58, 499, 25, 1133, 196, 317, 46, 74, 31, 34, 71,
41, 73, 64, 110, 106, 79, 723, 76, 138, 47, 199, 114, 26,
65, 405, 66, 38, 46, 104), NUM_UNIQUE_OPERANDS = c(15, 32,
33, 5, 7, 71, 5, 20, 37, 27, 8, 13, 9, 28, 25, 13, 5, 34,
5, 21, 18, 110, 8, 251, 57, 41, 17, 14, 19, 17, 33, 19, 25,
19, 23, 40, 37, 165, 31, 35, 18, 66, 39, 10, 16, 122, 21,
7, 28, 35), NUM_UNIQUE_OPERATORS = c(15, 27, 22, 4, 10, 20,
12, 15, 15, 19, 9, 17, 14, 22, 19, 14, 8, 12, 8, 13, 22,
45, 15, 69, 36, 13, 14, 18, 13, 15, 19, 15, 21, 16, 21, 22,
18, 52, 17, 26, 19, 24, 21, 11, 16, 24, 17, 9, 13, 19), NUMBER_OF_LINES
= c(32,
67, 83, 9, 20, 172, 19, 67, 112, 90, 21, 74, 74, 89, 71,
33, 11, 55, 9, 50, 34, 406, 33, 764, 155, 46, 26, 44, 58,
40, 70, 57, 75, 53, 68, 73, 74, 536, 124, 153, 32, 126, 132,
22, 41, 305, 31, 32, 35, 102), PATHOLOGICAL_COMPLEXITY = c(1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), PERCENT_COMMENTS = c(4,
39.22, 47.27, 0, 0, 11.67, 0, 52.83, 48.31, 53.42, 37.5,
54, 54, 35.42, 48.94, 45.83, 25, 5.71, 25, 2.38, 22.22, 34.69,
39.13, 38.71, 40.16, 24.39, 0, 25, 63.41, 45.83, 41.86, 40.54,
46.15, 53.85, 47.83, 26.92, 38, 48.42, 60.49, 41.8, 31.82,
37.37, 54.95, 42.86, 24.24, 32.22, 19.05, 27.27, 18.18, 52.86
), LOC_TOTAL = c(25, 32, 33, 7, 12, 106, 15, 37, 54, 45,
12, 33, 33, 33, 27, 19, 7, 35, 7, 42, 27, 240, 18, 398, 79,
31, 20, 31, 17, 16, 27, 27, 33, 21, 26, 40, 41, 210, 37,
77, 15, 67, 44, 8, 25, 154, 19, 8, 20, 40), Defective = structure(c(2L,
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 1L,
2L, 2L, 2L, 1L), .Label = c("Y", "N"), class =
"factor")), row.names c(NA,
50L), class = "data.frame")>
On Wed, Apr 15, 2020 at 11:55 PM Jeff Newmiller <jdnewmil at
dcn.davis.ca.us>
wrote:
> Someday, Neha, you will learn to post a reproducible example using plain
> text. I hope.
>
> Try using the reprex package.
>
> On April 15, 2020 2:32:03 PM PDT, Neha gupta <neha.bologna90 at
gmail.com>
> wrote:
> >What is the problem is the code..
> >
> >d=readARFF("CM1.arff")
> >
> >index <- createDataPartition(d$Defective, p = .70,list = FALSE)
> >tr <- d[index, ]
> >ts <- d[-index, ]
> >index_2 <- createFolds(tr$Defective, returnTrain = TRUE, list =
TRUE)
> >
> >ctrl <- trainControl(method = "boot", number=100, index =
index_2,
> >search="random", classProbs = TRUE,
> > summaryFunction=twoClassSummary,savePredictions = T)
> >
> >
> >net <- train(Defective ~ ., data = tr,
> > method = "nnet",
> > metric = "ROC",
> > preProc = c("center", "scale",
"nzv" ),
> > trControl = ctrl, na.action=na.exclude)
> >getTrainPerf(net)
> >
> >
> >I am getting the error as below:
> >
> >Something is wrong; all the ROC metric values are missing:
> > ROC Sens Spec
> > Min. : NA Min. : NA Min. : NA
> > 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
> > Median : NA Median : NA Median : NA
> > Mean :NaN Mean :NaN Mean :NaN
> > 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
> > Max. : NA Max. : NA Max. : NA
> > NA's :3 NA's :3 NA's :3
> >
> > [[alternative HTML version deleted]]
> >
> >______________________________________________
> >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.
>
> --
> Sent from my phone. Please excuse my brevity.
>
[[alternative HTML version deleted]]