Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with Date #19

Open
alexeks opened this issue Apr 17, 2021 · 2 comments
Open

Problems with Date #19

alexeks opened this issue Apr 17, 2021 · 2 comments

Comments

@alexeks
Copy link

alexeks commented Apr 17, 2021

Modeltimeh2o error is

Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page, :
ERROR MESSAGE:
Provided column type POSIXct is unknown. Cannot proceed with parse due to invalid argument.

If the Date is passed as a date (without minutes ann seconds) there is no error message

h2o code itself is running with minutes and seconds with no problems.
Both codes are below. The data file is attached.

library(modeltime)
library(modeltime.h2o)
library(modeltime.resample)
library(modeltime.ensemble)
library(timetk)
library(tidymodels)
library(tidyverse)
library(dplyr)
library(tidyr)
library(lubridate)
h20.csv

#h2o code without modeltime h2o
h2o.init(
nthreads = -1,
ip = 'localhost',
port = 54321
)

h2odf1<-h2o.importFile("C:/City of Chico/h20.csv")

aml <- h2o.automl(x = "Date", y = "total",
training_frame = h2odf1,
max_models = 20,
seed = 1)

lb <- aml@leaderboard
print(lb, n = nrow(lb))
#modeltime h2o code#################
h2o.init(
nthreads = -1,
ip = 'localhost',
port = 54321
)

model_spec <- automl_reg(mode = 'regression') %>%
set_engine(
engine = 'h2o',
max_runtime_secs = 5,
max_runtime_secs_per_model = 3,
max_models = 3,
nfolds = 5,
exclude_algos = c("DeepLearning"),
verbosity = NULL,
seed = 786
)

model_fitted1 <- model_spec %>%
fit(total ~ Date,data=as.data.frame(h2odf1))

@mdancho84
Copy link
Contributor

Will take a look and let you know.

@ichsan2895
Copy link

Modeltimeh2o error is

Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page, : ERROR MESSAGE: Provided column type POSIXct is unknown. Cannot proceed with parse due to invalid argument.
If the Date is passed as a date (without minutes ann seconds) there is no error message

h2o code itself is running with minutes and seconds with no problems.

Both codes are below. The data file is attached.
library(modeltime)
library(modeltime.h2o)
library(modeltime.resample)
library(modeltime.ensemble)
library(timetk)
library(tidymodels)
library(tidyverse)
library(dplyr)
library(tidyr)
library(lubridate)
h20.csv

#h2o code without modeltime h2o
h2o.init(
nthreads = -1,
ip = 'localhost',
port = 54321
)

h2odf1<-h2o.importFile("C:/City of Chico/h20.csv")

aml <- h2o.automl(x = "Date", y = "total",
training_frame = h2odf1,
max_models = 20,
seed = 1)

lb <- aml@leaderboard
print(lb, n = nrow(lb))
#modeltime h2o code#################
h2o.init(
nthreads = -1,
ip = 'localhost',
port = 54321
)

model_spec <- automl_reg(mode = 'regression') %>%
set_engine(
engine = 'h2o',
max_runtime_secs = 5,
max_runtime_secs_per_model = 3,
max_models = 3,
nfolds = 5,
exclude_algos = c("DeepLearning"),
verbosity = NULL,
seed = 786
)

model_fitted1 <- model_spec %>%
fit(total ~ Date,data=as.data.frame(h2odf1))

you can try
h2odf1_rev <- h2odf1 %>% mutate(Date = as.Date(Date))

then, you use that dataframe in this syntax
model_fitted1 <- model_spec %>% fit(total ~ Date, data=h2odf1_rev)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants