[英]Plotting Rsquare objects from three RFE
我使用插入符號包在R中創建了以下三種RFE類型:
lmresults = rfe(twoHoursDaily[,1:12], twoHoursDaily[,13], sizes = c(1:12), rfeControl = control)
treeBagresults = rfe(twoHoursDaily[,1:12], twoHoursDaily[,13], sizes = c(1:12), rfeControl = control)
RForestresults = rfe(twoHoursDaily[,1:12], twoHoursDaily[,13], sizes = c(1:12), rfeControl = control)
我需要在一個圖中繪制所有三個的Rsquares,但是我不知道如何為每個RFE訪問Rsquare對象。 我可以如下繪制Rsquare的值:
plot(treeBagresults, type = c("g","o"), metric = "Rsquared")
但是如何為每個對象訪問Rsquare對象,以便可以繪制所有三個圖所需的向量pr DF?
rfe
的輸出將是一個list
。 我們需要提取具有Rsquared對象的list
元素。 為了了解輸出的結構,我們可以使用str(lmresults)
。 從那里獲取results
元素
lmresults$results[["Rsquared"]]
同樣,對於其他對象。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.