Labs SVM MultiDimensional Scaling Dimension Reduction Factor Analysis
Labs: (SVM, Multi-Dimensional Scaling, Dimension Reduction), Factor Analysis, Random. Forest Peter Fox Data Analytics – ITWS-4600/ITWS-6600 Week 10 b, April 8, 2016 1
If you did not complete svm • • 9 b labs were incorrectly labeled 8 b Lab 8 b_svm{1, 11}_2016. R Lab 8 b_svm{12, 13}_2016. R Lab 8 b_svm_rpart 1_2016. R 2
And MDS, DR • Lab 8 b_mds{1, 3}_2016. R • Lab 8 b_dr{1, 4}_2016. R • http: //www. statmethods. net/advstats/mds. htm l • http: //gastonsanchez. com/blog/howto/2013/01/23/MDS-in-R. html 3
Try these • example_exploratory. Factor. Analysis. R on dataset_exploratory. Factor. Analysis. csv (on website) – http: //rtutorialseries. blogspot. com/2011/10/rtutorial-series-exploratory-factor. html (this was the example skipped over in lecture 10 a) • http: //www. statmethods. net/advstats/factor. ht ml • http: //stats. stackexchange. com/questions/157 6/what-are-the-differences-between-factoranalysis-and-principal-component-analysi • Do these - Lab 10 b_fa{1, 2, 4, 5}_2016. R 4
Factor Analysis data(iqitems) # data(ability) ability. irt <- irt. fa(ability) ability. scores <- score. irt(ability. irt, ability) data(attitude) cor(attitude) # Compute eigenvalues and eigenvectors of the correlation matrix. pfa. eigen<-eigen(cor(attitude)) pfa. eigen$values # set a value for the number of factors (for clarity) factors<-2 # Extract and transform two components. pfa. eigen$vectors [ , 1: factors ] %*% + diag ( sqrt (pfa. eigen$values [ 1: factors ] ), factors ) 5
Glass index <- 1: nrow(Glass) testindex <- sample(index, trunc(length(index)/3)) testset <- Glass[testindex, ] trainset <- Glass[-testindex, ] Cor(testset) Factor Analysis? 6
random. Forest > library(e 1071) > library(rpart) > library(mlbench) # etc. > data(kyphosis) > require(random. Forest) # or library(random. Forest) > fit. KF <- random. Forest(Kyphosis ~ Age + Number + Start, data=kyphosis) > print(fit. KF) # view results > importance(fit. KF) # importance of each predictor # what else can you do? data(swiss) # fertility? Lab 10 b_rf 3_2016. R data(Glass, package=“mlbench”) # Type ~ <what>? data(Titanic) # Survived ~. Find - Mileage~Price + Country + Reliability + Type 7
- Slides: 7