来自as.h2o的对象在R中有一点观察

时间:2017-07-26 06:35:54

标签: r deep-learning h2o

我尝试使用as.h2o函数将R数据转换为h2o数据。

然而,由as.h2o函数转换的观测数量减少到10.

我的数据总共有1,000个观测值。有700个列车数据和300个测试数据。但是,使用as.h2o函数只有10个观察值。

以下是我的完整开源代码。你可以使用它。请帮帮我。

为什么转换为h2o数据的数据有10个观察值?

install.packages("h2o")
library(h2o)
h2o.init(max_mem_size = "10G", nthreads = -1)

df<-read.csv("http://freakonometrics.free.fr/german_credit.csv", header=TRUE)
F=c(1,2,4,5,7,8,9,10,11,12,13,15,16,17,18,19,20,21)
for(i in F) df[,i]=as.factor(df[,i])

library(caret)

set.seed(1000)
intrain<-createDataPartition(y=df$Creditability, p=0.7, list=FALSE)
train<-df[intrain, ]
test<-df[-intrain, ]
str(train)
str(test)

h2o_train<-as.h2o(train, destination_frame = "h2o_train")
h2o_test<-as.h2o(test, destination_frame = "h2o_test")
str(h2o_train)
str(h2o_test)

1 个答案:

答案 0 :(得分:1)

这似乎是 <?php require_once 'dbconfig.php'; if(isset($_POST['selectItems'])) { echo array[] = $_POST['chk[]']; echo $oth_online_id= $_POST['online_id']; if($oth_event_detid != ""){ for($i=0;$i<sizeof($oth_event_detid);$i++) { // oth_event_det_id,oth_online_id $stmt = $DB_con->prepare('INSERT INTO othevents_itemsonline(oth_event_det_id,oth_online_id) VALUES( :oth_event_det_id, :oth_online_id)'); $stmt->bindParam(':oth_event_det_id',$oth_event_det_id); $stmt->bindParam(':oth_online_id',$oth_online_id); if($stmt->execute()) { $lastonlineid= $DB_con->lastInsertId(); $successMSG = "Thank you For Registering with us . Please select the items to be participating..."; // header("refresh:0;OtherEventsOnlineRegistrationThankyou.php"); / } else { $errMSG = "error while registering...."; } } } } ?> 显示H2O框架的一个奇怪现象,而不是实际问题。如果您查看Flow(localhost:54321)或在h2o对象上调用str(),您将看到您期望的结果。