Question: Why did I get these errors when I run the code. It is a binary classification metric. I did the logical regression and when I
Why did I get these errors when I run the code. It is a binary classification metric. I did the logical regression and when I run the confusion matrix table(), I got this error message: "All arguments must have the same length". I don't know what is the problem?
We can get the dataset from (Ionosphere, package = 'mlbench')
We have to remove the first two columns (V1&V2) which I already did. So the new data will be V3 through V34 and the last column name is Class which is the response with two levels (good and bad)

History Run Source 11 Part2.Ionosphere.R* * I Source on Save 9 30 #these probabilities into labels 31 Ionosphere. logreg 0.5, "good", "bad")) 38 head (predicted. classes) 39 predicted. classes $V35 == IonosphereSV35 # (use wafn message in R markdown) 40 41 # compute the overall accuracy 42 mean (predicted. classes $V35 == Ionosphere$V35) 43 # accuracy rate is 0.604 (use warn msg in markdwon) 44 table(predicted. classes $V35, Ionospheresv35) 45 #calculating the 95% CI of accuracy for logical regression model 46 z mean(predicted. classes $V35 == Ionosphere $V35) [1] 0.6039886 warning messages: 1: In ==. default (predicted.classes $V35, IonosphereSV35) : longer object length is not a multiple of shorter object length 2: In is.na(el) is.na(e) : longer object length is not a multiple of shorter object length > # accuracy rate is 0.604 (use warn msg in markdwon) > table(predicted. classes SV35, Ionosphere$v35) Error in table(predicted. classes $V35, Ionosphere$V35) : all arguments must have the same length + 9:04 AM
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
