1

I am running the h2o package in Rstudio, I am getting an error while converting Tibble into h2o.

Below is my code

#Augment Time Series Signature
PO_Data_aug = PO_Data %>%
  tk_augment_timeseries_signature()

PO_Data_aug


# Split into training, validation and test sets
train_tbl = PO_Data_aug %>% filter(Date <= '2017-12-29')
valid_tbl = PO_Data_aug %>% filter(Date>'2017-12-29'& Date <='2018-03-31')
test_tbl  = PO_Data_aug %>% filter(Date > '2018-03-31')
str(train_tbl)
train_tbl$month.lbl<-as.character(train_tbl$month.lbl)

h2o.init()        # Fire up h2o

##hex
train_h2o = as.h2o(train_tbl)
valid_h2o = as.h2o(valid_tbl)
test_h2o  = as.h2o(test_tbl)



ERROR: Unexpected HTTP Status code: 412 Precondition Failed (url = http://localhost:54321/3/Parse)



ERROR MESSAGE:

Provided column type ordered is unknown.  Cannot proceed with parse due to invalid argument.

Kindly Suggest

Rob
  • 14,746
  • 28
  • 47
  • 65
Nitish Sherje
  • 31
  • 1
  • 4
  • try converting to a csv first and importing that. – TomKraljevic Jul 31 '18 at 12:35
  • I am not able to replicate the issue because you did not provide a publicly available dataset in your code. `as.h2o(tibble(x = runif(10), y = x * 2))` works fine so I don't know if there is something special about your data that is causing this to fail (maybe the date column?). Please provide data if you can. – Erin LeDell Jul 31 '18 at 22:36
  • You keep using h2o-http as a tag and that has nothing to do with R or Python or anything related to this. It's server software. – Rob Jan 20 '19 at 13:24

2 Answers2

1

This is actually a bug in H2O -- it has nothing to do with tibbles. There is no support for the "ordered" column type in data.frames or tibbles. We will fix this (ticket here).

The work-around right now is to manually convert your "ordered" columns into un-ordered "factor" columns.

tb <- tibble(x = ordered(c(1,2,3)), y = 1:3)
tb$x <- factor(tb$x, ordered = FALSE)
hf <- as.h2o(tb)
Erin LeDell
  • 8,704
  • 1
  • 19
  • 35
0

as.h2o() expects an R dataframe. You could use an R dataframe instead of your tibble dataframe or as Tom mentioned in the comments you could use one of the supported file formats for H2O.

train_h2o = as.h2o(as_data_frame(train_tbl))
valid_h2o = as.h2o(as_data_frame(valid_tbl))
test_h2o  = as.h2o(as_data_frame(test_tbl))
Erin LeDell
  • 8,704
  • 1
  • 19
  • 35
Lauren
  • 5,640
  • 1
  • 13
  • 19