100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

ISYE 6501 9/5/2019 Homework 2, Georgia Tech, Graded A+ Document Content and Description Below

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
25-04-2023
Written in
2022/2023

ISYE 6501 9/5/2019 Homework 2, Georgia Tech, Graded A+ Document Content and Description Below ISYE 6501 9/5/2019 Homework 2 Question 3.1: Using the same data set (credit_card_ or credit_card_) as in Question 2.2, use the ksvm or kknn function to find a good classifi er: (a) using cross-validation (do this for the k-nearest-neighbors model; SVM is optional); Answer: To approach cross-validation for the KNN model, I attempted to leverage the kknn’s built-in cross-validation function: . This function uses leave-one-out cross-validation which means that every data point has a model fit to all other data points. LOOCV is essentially doing cross-validation X number of times where X is the number of data points. In my approach, I decided to test 20 values of K (just as in week 1) except this time I introduced a Kmax variable for robustness of code (easy to change to test more values). I once again scaled the data for a better fit. The total number of correctly predicted data points, were divided by the total number of data points to give a percentage of correct points for each K value. The results indicated that low values of K performed the worst (i.e K=1 is only 81% accurate) and that K>5 tends to produce fairly similar results with peaks around K=12 and K=15-17 at 85.3% accuracy. It is important to note that despite a decently high predictive value here, our model quality might not necessarily be high and we would need extraneous data outside of our train/validation set to confirm. To approach cross-validation for the SVM model, I simply found the argument parameter cross to include at the end of my line call for the KSVM function from last week’s homework and set that equal to 20 to do 20x cross validation of the data. I also found the call: model@cross which shows the error measured by cross-validation, and hence could use that to determine the accuracy of this model. Finally I used a for loop with various values of C in order to test the accuracy of each one (I tested 10 values from 0. to 1000 by magnitudes of 10). As noted in last week’s homework, larger values of C tend to give better results but reaching a saturation point around C=0.01 of about 86.2% accuracy. Code: KNN rm(list = ls()) ges("kknn") library(kknn) data <- ("/Users/Vikram/Downloads/credit_card_", stringsAsFactors = FALSE, header = FALSE) head(data) (1) kmax <- 20 model <- (V11~.,data,kmax=kmax,scale=TRUE) accuracy <- rep(0,kmax) for (k in 1:kmax) { This study source was downloaded by from CourseH on :04:36 GMT -05:00

Show more Read less
Institution
ISYE 6501
Module
ISYE 6501









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
ISYE 6501
Module
ISYE 6501

Document information

Uploaded on
April 25, 2023
Number of pages
7
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

  • georgia tech

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Savior NCSU
View profile
Follow You need to be logged in order to follow users or courses
Sold
93
Member since
2 year
Number of followers
70
Documents
3434
Last sold
1 month ago

3.5

25 reviews

5
9
4
7
3
3
2
0
1
6

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions