Есть такой вот код на R
dim(training)
[1] 11776 160
dim(testing)
[1] 7846 160
numIndex <- sapply(training, is.numeric)
preProc <-preProcess(training[,numIndex],method="pca",pcaComp=50)
trainPC<-predict(preProc,training[,numIndex])
modelFit<-train(training$classe~.,method="rpart",data=trainPC
testPC<-predict(preProc,testing[,numIndex])
length(predict(modelFit,testPC))
[1] 170