TSW
TSW

Reputation: 661

Exporting Caret Resamples Results Summary to dataframe/csv

I have run several train objects and collected the resampling results via the resamples() function in caret. However, I would like to export those results to a data frame or ideally to a csv directly. Is there any simple way of doing this?

Thanks!

Upvotes: 2

Views: 981

Answers (2)

Rooirokbokkie
Rooirokbokkie

Reputation: 252

I know this question is about a million years old, but I had the exact same problem and in case someone else runs into this problem, you have to write it to a data frame first:

resamples <-data.frame(pls_model$resample)

You can then export it as a csv

write.csv(resamples, file = "Your_FileName.csv")

Upvotes: 2

s_scolary
s_scolary

Reputation: 1399

use the write.csv() function

write.csv(data,file="Your_FileName.csv",row.names=F)

I prefer to remove the rownames from the CSV, but whatever you prefer

Upvotes: 0

Related Questions