Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
R Tree Export in Excel RODBC

R Tree Export in Excel RODBC

Ratings: (0)|Views: 149|Likes:
Published by Amitmse

More info:

Published by: Amitmse on Jun 02, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

06/02/2011

pdf

text

original

 
load("D:\\Shopzilla\\CTR\\Data\\Stream 5\\dev_sam2_pos1_2000_50.RData")ch <- odbcConnectExcel("D:\\Shopzilla\\CTR\\Data\\Stream 5\\pos1_trees.xls", F)for (x in c(1:10)) {sqlSave (ch, data.frame(getTree(dev_sam2_pos1.rf, x, "TRUE")), x, T)}sqlSave (ch, data.frame(dev_sam2_pos1.rf$importance), 11, T)odbcClose(ch)**********************************22222222222222********************load("D:\\Shopzilla\\CTR\\Data\\Stream 5\\dev_sam2_pos23_2000_50.RData")ch <- odbcConnectExcel("D:\\Shopzilla\\CTR\\Data\\Stream 5\\pos23_trees.xls", F)for (x in c(1:10)) {sqlSave (ch, data.frame(getTree(dev_sam2_pos23.rf, x, "TRUE")), x, T)}sqlSave (ch, data.frame(dev_sam2_pos23.rf$importance), 11, T)odbcClose(ch)**********************************33333333333333********************load("D:\\Shopzilla\\CTR\\Data\\Stream 5\\dev_sam2_pos46.RData")ch <- odbcConnectExcel("D:\\Shopzilla\\CTR\\Data\\Stream 5\\pos46_trees.xls", F)for (x in c(1:10)) {sqlSave (ch, data.frame(getTree(dev_sam2_pos46.rf, x, "TRUE")), x, T)}sqlSave (ch, data.frame(dev_sam2_pos46.rf$importance), 11, T)odbcClose(ch)**********************************44444444444444444********************load("D:\\Shopzilla\\CTR\\Data\\Stream 5\\dev_sam2_pos711_1000_50.RData")ch <- odbcConnectExcel("D:\\Shopzilla\\CTR\\Data\\Stream 5\\pos711_trees.xls", F)for (x in c(1:10)) {sqlSave (ch, data.frame(getTree(dev_sam2_pos711.rf, x, "TRUE")), x, T)}sqlSave (ch, data.frame(dev_sam2_pos711.rf$importance), 11, T)odbcClose(ch)**********************************55555555555555555555********************load("D:\\Shopzilla\\CTR\\Data\\Stream 5\\dev_sam2_posgt12_500_50.RData")ch <- odbcConnectExcel("D:\\Shopzilla\\CTR\\Data\\Stream 5\\posgt12_trees.xls",F)for (x in c(1:10)) {sqlSave (ch, data.frame(getTree(dev_sam2_posgt12.rf, x, "TRUE")), x, T)}sqlSave (ch, data.frame(dev_sam2_posgt12.rf$importance), 11, T)
 
odbcClose(ch)********************************************************************************> local({pkg <- select.list(sort(.packages(all.available = TRUE)))+ if(nchar(pkg)) library(pkg, character.only=TRUE)})> utils:::menuInstallPkgs()--- Please select a CRAN mirror for use in this session ---trying URL 'http://cran.stat.nus.edu.sg/bin/windows/contrib/2.9/RODBC_1.3-1.zip'Content type 'application/zip' length 756974 bytes (739 Kb)opened URLdownloaded 739 Kbpackage 'RODBC' successfully unpacked and MD5 sums checkedThe downloaded packages are inC:\Documents and Settings\Administrator.LATENTVIEWCHN\Local Settings\Temp\2\RtmpKm6MDr\downloaded_packagesupdating HTML package descriptions> local({pkg <- select.list(sort(.packages(all.available = TRUE)))+ if(nchar(pkg)) library(pkg, character.only=TRUE)})> load("D:\\Shopzilla\\CTR\\Data\\Stream 5\\dev_sam2_pos1_2000_50.RData")> ch <- odbcConnectExcel("D:\\pos1_trees.xls", F)> for (x in c(1:10)) {++ sqlSave (ch, data.frame(getTree(dev_sam2_pos1.rf, x, "TRUE")), x, T)+ }Error in data.frame(getTree(dev_sam2_pos1.rf, x, "TRUE")) :could not find function "getTree"> local({pkg <- select.list(sort(.packages(all.available = TRUE)))+ if(nchar(pkg)) library(pkg, character.only=TRUE)})randomForest 4.5-34Type rfNews() to see new features/changes/bug fixes.> for (x in c(1:10)) {++ sqlSave (ch, data.frame(getTree(dev_sam2_pos1.rf, x, "TRUE")), x, T)+ }> load("D:\\Shopzilla\\CTR\\Data\\Stream 5\\dev_sam2_pos1_2000_50.RData")> ch <- odbcConnectExcel("D:\\Shopzilla\\CTR\\Data\\Stream 5\\pos1_trees.xls", F)>> for (x in c(1:10)) {++ sqlSave (ch, data.frame(getTree(dev_sam2_pos1.rf, x, "TRUE")), x, T)+ }Warning message:closing unused RODBC handle 1>> odbcClose(ch)> load("D:\\Shopzilla\\CTR\\Data\\Stream 5\\dev_sam2_pos1_2000_50.RData")> ch <- odbcConnectExcel("D:\\Shopzilla\\CTR\\Data\\Stream 5\\pos1_trees.xls", F)>> for (x in c(1:10)) {++ sqlSave (ch, data.frame(getTree(dev_sam2_pos1.rf, x, "TRUE")), x, T)+ }> sqlSave (ch, data.frame(dev_sam2_pos1.rf$importance, 11, T)+ odbcClose(ch)
 
Error: unexpected symbol in:"sqlSave (ch, data.frame(dev_sam2_pos1.rf$importance, 11, T)odbcClose"> dev_sam2_pos1.rf$importance0 1 MeanDecreaseAccuracyIND_IMPUTED_MFT -2.335249e-03 0.0052095738 -2.145464e-03IND_IMPUTED_MID -4.958533e-04 0.0016896379 -4.407900e-04MFT_SPEC2 -1.706909e-02 0.0359470443 -1.573237e-02IND_IMPUTED_MFT_SPEC -2.126976e-03 0.0059920372 -1.922106e-03MID_SPEC2 -1.192591e-02 0.0273249381 -1.093721e-02IND_IMPUTED_MID_SPEC -9.189093e-04 0.0018679651 -8.483831e-04OFFER_MERCH_PRICE -2.447303e-02 0.0496713435 -2.260291e-02MEAN_IMAGE_FLAG -9.442732e-04 0.0014268410 -8.847344e-04MEAN_FINAL_CLASSIFY_NUM -1.036427e-02 0.0260230319 -9.446744e-03MeanDecreaseGiniIND_IMPUTED_MFT 2.1486847IND_IMPUTED_MID 1.5954245MFT_SPEC2 26.2243620IND_IMPUTED_MFT_SPEC 1.6679762MID_SPEC2 17.7182209> sqlSave (ch, data.frame(data.frame(dev_sam2_pos1.rf$importance), 11, T)+ )Error in sqlSave(ch, data.frame(data.frame(dev_sam2_pos1.rf$importance), :
data.frame

dev_sam2_pos1.rf$importance
should be a name> sqlSave (ch, data.frame(dev_sam2_pos1.rf$importance), 11, T)> odbcClose(ch)> load("D:\\Shopzilla\\CTR\\Data\\Stream 5\\dev_sam2_pos23_2000_50.RData")> ch <- odbcConnectExcel("D:\\Shopzilla\\CTR\\Data\\Stream 5\\pos23_trees.xls",F)> ls()[1] "ch" "dev_sam2_pos1" "dev_sam2_pos1.rf"[4] "dev_sam2_pos23" "dev_sam2_pos23.rf" "x"> for (x in c(1:10)) {++ sqlSave (ch, data.frame(getTree(dev_sam2_pos23.rf, x, "TRUE")), x, T)+ }> sqlSave (ch, data.frame(dev_sam2_pos1.rf$importance), 11, T)> odbcClose(ch)> ls()[1] "ch" "dev_sam2_pos1" "dev_sam2_pos1.rf"[4] "dev_sam2_pos23" "dev_sam2_pos23.rf" "x"> load("D:\\Shopzilla\\CTR\\Data\\Stream 5\\dev_sam2_pos46.RData")> ch <- odbcConnectExcel("D:\\Shopzilla\\CTR\\Data\\Stream 5\\pos46_trees.xls",F)> ls()[1] "ch" "dev_sam2_pos1" "dev_sam2_pos1.rf"[4] "dev_sam2_pos23" "dev_sam2_pos23.rf" "dev_sam2_pos46"[7] "dev_sam2_pos46.rf" "x">> for (x in c(1:10)) {++ sqlSave (ch, data.frame(getTree(dev_sam2_pos46.rf, x, "TRUE")), x, T)+ }> sqlSave (ch, data.frame(dev_sam2_pos1.rf$importance), 11, T)> odbcClose(ch)> load("D:\\Shopzilla\\CTR\\Data\\Stream 5\\dev_sam2_pos711_1000_50.RData")> ch <- odbcConnectExcel("D:\\Shopzilla\\CTR\\Data\\Stream 5\\pos711_trees.xls",F)

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->