Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am trying to fit classifier using SVM for a dataset with multiple variable. r-code attach(wifiLocDat) x

I am trying to fit classifier using SVM for a dataset with multiple variable.

r-code

attach(wifiLocDat) x <- subset(wifiLocDat, select=-Loc3) y <- Loc3 x[y==1 ,] <- x[y==1,] + 1 wifiDat <- data.frame(x=x,y=as.factor(y)) svmfit <- svm(Loc3~., data=wifiLocDat, kernel="linear", cost=1, scale=FALSE) plot(svmfit,wifiDat) 

Error code:

Error in plot.svm(svmfit, wifiDat) : missing formula.

Sample Data

 WiFi1 WiFi2 WiFi3 WiFi4 WiFi5 WiFi6 WiFi7 Loc3 1 -64 -56 -61 -66 -71 -82 -81 FALSE 2 -68 -57 -61 -65 -71 -85 -85 FALSE 3 -63 -60 -60 -67 -76 -85 -84 TRUE 4 -61 -60 -68 -62 -77 -90 -80 FALSE 5 -63 -65 -60 -63 -77 -81 -87 TRUE 6 -64 -55 -63 -66 -76 -88 -83 FALSE 

How can I fix this error?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions