Error Pop in runing my confusion matrix

Am trying to run my confusion matrix after making my categorical variables into dummy variables but still yest here below
train_b <- bake(data_recipe, new_data = train)
test_b <- bake(data_recipe, new_data = test)
sum(is.na(train_b))
glimpse(train_b)

output
[1] 0
Rows: 3,487
Columns: 57
Income..in.K.month. <dbl> -0.32315610, -0.71410509, 0.58905822, -0.27971732, -0.62722754, -1.17021225, 2.34832869, -0.71410509, -0.953... Family.members -1.37779871, -0.09562395, -1.37779871, 0.65440020, -1.37779871, 1.18655081, -0.09562395, -1.37779871, -1.377...
CCAvg <dbl> -0.20110826, -1.06152735, 0.54458828, 0.41265736, -0.37319208, -0.88944353, 0.77403337, -1.00416607, -0.5452... Education -1.045993, -1.045993, 1.348871, -1.045993, 0.151439, 0.151439, 1.348871, -1.045993, 1.348871, 0.151439, 0.15...
Mortgage <dbl> -0.5550857, 1.0408755, 1.1300908, -0.5550857, -0.5550857, 0.2280257, 3.1324769, -0.5550857, 0.5452354, 0.475... Securities.Account -0.3507023, -0.3507023, 2.8506037, -0.3507023, -0.3507023, -0.3507023, -0.3507023, -0.3507023, -0.3507023, -...
CD.Account <dbl> -0.252468, -0.252468, -0.252468, -0.252468, -0.252468, -0.252468, -0.252468, -0.252468, -0.252468, 3.959762,... Online 0.8321777, 0.8321777, -1.2013218, 0.8321777, 0.8321777, 0.8321777, -1.2013218, 0.8321777, -1.2013218, 0.8321...
CreditCard <dbl> -0.6420237, 1.5571282, -0.6420237, -0.6420237, -0.6420237, 1.5571282, -0.6420237, 1.5571282, -0.6420237, 1.5... Experience 1.036794249, -0.968558110, -1.317315042, 1.123983482, 0.252091152, -0.532611945, 1.123983482, 0.949605016, -...
Personal.Loan <int> 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... Age_X.2 -0.04794634, -0.04794634, -0.04794634, -0.04794634, -0.04794634, -0.04794634, -0.04794634, -0.04794634, -0.0...
Age_X.1 <dbl> -0.08323713, -0.08323713, -0.08323713, -0.08323713, -0.08323713, -0.08323713, -0.08323713, -0.08323713, -0.0... Age_X0 -0.1143243, -0.1143243, -0.1143243, -0.1143243, -0.1143243, -0.1143243, -0.1143243, -0.1143243, -0.1143243, ...
Age_X1 <dbl> -0.1218137, -0.1218137, -0.1218137, -0.1218137, -0.1218137, -0.1218137, -0.1218137, -0.1218137, -0.1218137, ... Age_X2 -0.1388779, -0.1388779, -0.1388779, -0.1388779, -0.1388779, -0.1388779, -0.1388779, -0.1388779, 7.1985046, -...
Age_X3 <dbl> -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, ... Age_X4 -0.1472263, -0.1472263, -0.1472263, -0.1472263, -0.1472263, -0.1472263, -0.1472263, -0.1472263, -0.1472263, ...
Age_X5 <dbl> -0.1645931, -0.1645931, 6.0738448, -0.1645931, -0.1645931, -0.1645931, -0.1645931, -0.1645931, -0.1645931, -... Age_X6 -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, ...
Age_X7 <dbl> -0.1682323, -0.1682323, -0.1682323, -0.1682323, -0.1682323, -0.1682323, -0.1682323, -0.1682323, -0.1682323, ... Age_X8 -0.1472263, -0.1472263, -0.1472263, -0.1472263, -0.1472263, -0.1472263, -0.1472263, -0.1472263, -0.1472263, ...
Age_X9 <dbl> -0.1778981, 5.6195842, -0.1778981, -0.1778981, -0.1778981, -0.1778981, -0.1778981, -0.1778981, -0.1778981, -... Age_X10 -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, ...
Age_X11 <dbl> -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, ... Age_X12 -0.1410076, -0.1410076, -0.1410076, -0.1410076, -0.1410076, -0.1410076, -0.1410076, -0.1410076, -0.1410076, ...
Age_X13 <dbl> -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, ... Age_X14 -0.1618158, -0.1618158, -0.1618158, -0.1618158, -0.1618158, 6.1780924, -0.1618158, -0.1618158, -0.1618158, -...
Age_X15 <dbl> -0.1512417, -0.1512417, -0.1512417, -0.1512417, -0.1512417, -0.1512417, -0.1512417, -0.1512417, -0.1512417, ... Age_X16 -0.1618158, -0.1618158, -0.1618158, -0.1618158, -0.1618158, -0.1618158, -0.1618158, -0.1618158, -0.1618158, ...
Age_X17 <dbl> -0.1532134, -0.1532134, -0.1532134, -0.1532134, -0.1532134, -0.1532134, -0.1532134, -0.1532134, -0.1532134, ... Age_X18 -0.1673291, -0.1673291, -0.1673291, -0.1673291, -0.1673291, -0.1673291, -0.1673291, -0.1673291, -0.1673291, ...
Age_X19 <dbl> -0.1700259, -0.1700259, -0.1700259, -0.1700259, -0.1700259, -0.1700259, -0.1700259, -0.1700259, -0.1700259, ... Age_X20 -0.1804548, -0.1804548, -0.1804548, -0.1804548, -0.1804548, -0.1804548, -0.1804548, -0.1804548, -0.1804548, ...
Age_X21 <dbl> -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, ... Age_X22 -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, -0.1541906, ...
Age_X23 <dbl> -0.1796061, -0.1796061, -0.1796061, -0.1796061, 5.5661421, -0.1796061, -0.1796061, -0.1796061, -0.1796061, -... Age_X24 -0.1580447, -0.1580447, -0.1580447, -0.1580447, -0.1580447, -0.1580447, -0.1580447, -0.1580447, -0.1580447, ...
Age_X25 <dbl> -0.1709164, -0.1709164, -0.1709164, -0.1709164, -0.1709164, -0.1709164, -0.1709164, -0.1709164, -0.1709164, ... Age_X26 -0.1682323, -0.1682323, -0.1682323, -0.1682323, -0.1682323, -0.1682323, -0.1682323, -0.1682323, -0.1682323, ...
Age_X27 <dbl> -0.1580447, -0.1580447, -0.1580447, -0.1580447, -0.1580447, -0.1580447, -0.1580447, -0.1580447, -0.1580447, ... Age_X28 -0.1700259, -0.1700259, -0.1700259, -0.1700259, -0.1700259, -0.1700259, -0.1700259, -0.1700259, -0.1700259, ...
Age_X29 <dbl> -0.150247, -0.150247, -0.150247, -0.150247, -0.150247, -0.150247, -0.150247, -0.150247, -0.150247, -0.150247... Age_X30 -0.1645931, -0.1645931, -0.1645931, -0.1645931, -0.1645931, -0.1645931, -0.1645931, -0.1645931, -0.1645931, ...
Age_X31 <dbl> -0.1512417, -0.1512417, -0.1512417, -0.1512417, -0.1512417, -0.1512417, -0.1512417, 6.6100374, -0.1512417, -... Age_X32 5.5661421, -0.1796061, -0.1796061, -0.1796061, -0.1796061, -0.1796061, -0.1796061, -0.1796061, -0.1796061, -...
Age_X33 <dbl> -0.1551623, -0.1551623, -0.1551623, 6.4430181, -0.1551623, -0.1551623, 6.4430181, -0.1551623, -0.1551623, -0... Age_X34 -0.1599403, -0.1599403, -0.1599403, -0.1599403, -0.1599403, -0.1599403, -0.1599403, -0.1599403, -0.1599403, ...
Age_X35 <dbl> -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, -0.1664216, ... Age_X36 -0.1482395, -0.1482395, -0.1482395, -0.1482395, -0.1482395, -0.1482395, -0.1482395, -0.1482395, -0.1482395, ...
Age_X37 <dbl> -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, -0.1522304, ... Age_X38 -0.1367175, -0.1367175, -0.1367175, -0.1367175, -0.1367175, -0.1367175, -0.1367175, -0.1367175, -0.1367175, ...
Age_X39 <dbl> -0.1300373, -0.1300373, -0.1300373, -0.1300373, -0.1300373, -0.1300373, -0.1300373, -0.1300373, -0.1300373, ... Age_X40 -0.1117224, -0.1117224, -0.1117224, -0.1117224, -0.1117224, -0.1117224, -0.1117224, -0.1117224, -0.1117224, ...
Age_X41 <dbl> -0.09773127, -0.09773127, -0.09773127, -0.09773127, -0.09773127, -0.09773127, -0.09773127, -0.09773127, -0.0... Age_X42 -0.03388371, -0.03388371, -0.03388371, -0.03388371, -0.03388371, -0.03388371, -0.03388371, -0.03388371, -0.0...
$ Age_X43 -0.02933994, -0.02933994, -0.02933994, -0.02933994, -0.02933994, -0.02933994, -0.02933994, -0.02933994, -0.0...

i was trying to run
logis<- train(form=Personal.Loan~., data=train_b,method="glm", family="binomial",trControl=cv.ctrl)

and got this error message
You are trying to do regression and your outcome only has two possible values Are you trying to do classification? If so, use a 2 level factor as your outcome column.prediction from a rank-deficient fit may be misleadingprediction from a rank-deficient fit may be misleadingglm.fit: algorithm did not convergeglm.fit: fitted probabilities numerically 0 or 1 occurredprediction from a rank-deficient fit may be misleading

whichi i have done here below
oan$Mortgage <- as.factor(loan$Mortgage)
loan$Securities.Account <- as.factor(loan$Securities.Account)
loan$CD.Account <- as.factor(loan$CD.Account)
loan$Online <- as.factor(loan$Online)
loan$CreditCard <- as.factor(loan$CreditCard)
str(loan)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.