0
我怎樣才能讀取R到.net的樹值?我試過這種方法,但它返回我空R.net閱讀樹
engine.Evaluate("data=read.spss(file='C:/dev/Anomaly/Vorselaar2011D.sav', to.data.frame=TRUE)");
engine.Evaluate("data$timestamp<-as.Date(as.POSIXct(data$timestamp, origin = \"1582-10-14\", tz = \"GMT\"))");
var data =engine.Evaluate("treeElect<-tree(Electricity_kWh~Water_lh+Day_of_Week+TempOut_mean+GasM3h, data=data)");
var dataset = engine.Evaluate("treeElect").AsDataFrame();
當我R中控制檯做到這一點我可以看到這個輸出
> treeElect
node), split, n, deviance, yval
* denotes terminal node
1) root 365 1006000 146.40
2) Water_lh < 214 123 84580 85.46
4) GasM3h < 64 94 10540 77.95 *
5) GasM3h > 64 29 51550 109.80
10) Day_of_Week < 5 5 9028 186.30 *
11) Day_of_Week > 5 24 7148 93.86 *
3) Water_lh >0 177.40
6) Water_lh < 582.25 90 44470 154.70
12) GasM3h < 87.75 75 20880 149.00 *
13) GasM3h > 87.75 15 8857 183.30 *
7) Water_lh > 582.25 152 113800 190.90
14) GasM3h < 54.4 72 29300 175.30 *
15) GasM3h > 54.4 80 51360 204.90
30) Day_of_Week < 1.5 22 5340 231.50 *
31) Day_of_Week > 1.5 58 24540 194.80 *