Questions tagged [timetk]
14 questions
2
votes
2 answers
Can I use xgboost global model properly, if I skip step_dummy(all_nominal_predictors(), one_hot = TRUE)?
I wanted to try xgboost global model from: https://business-science.github.io/modeltime/articles/modeling-panel-data.html
On smaller scale it works fine( Like wmt data-7 departments,7ids), but what if I would like to run it on 200 000 time series…

igor_262
- 21
- 2
1
vote
1 answer
In R package 'timetk', how to understand the parameter 'difference' in function 'diff_vec'?
In R package 'timetk', how to understand the parameter 'difference' in function 'diff_vec'?
library(timetk)
1:10 %>% diff_vec(lag=1)
#result: [1] NA 1 1 1 1 1 1 1 1 1
I try to change the valus of 'difference', but can't understand the…

anderwyang
- 1,801
- 4
- 18
1
vote
1 answer
Is there a data.table way of filling in gaps of time periods?
Is there an elegant way of filling in missing time periods as timetk::pad_by_time and tsibble::fill_gaps in data.table?
The data might look like this
library(data.table)
data<-data.table(Date =…

Nick
- 81
- 1
- 6
1
vote
1 answer
dplyr dynamically create lag and ma features
I am trying to create a process that takes in a dataframe and creates additional lagged and rolling window features (e.g. moving average). This is what I have so far.
# dummy dataframe
n <- 20
set.seed(123)
foo <- data.frame(
date =…

takmers
- 71
- 1
- 5
0
votes
0 answers
Forecasting time series groups based on trends using nested data in R
Reminiscent of this question: Forecasting Time Series Groups with tslm() & tidyverse
except I want to use Matt Dancho’s code at https://cran.rstudio.com/web/packages/sweep/vignettes/SW01_Forecasting_Time_Series_Groups.html
How can I use…

Rick Pack
- 1,044
- 10
- 20
0
votes
0 answers
In `timetk` ,how to pad time by week?
How to pad date by week ? In timetk ,below code want to pad time by week ,but it failed.
Anyone can help ? Thanks!
library(tidyverse)
library(timetk)
df <- data.frame(month_day=as.Date(c('2022-1-1','2022-2-1','2022-3-1')),
…

anderwyang
- 1,801
- 4
- 18
0
votes
1 answer
Error in step_fourier from timetk package
I have the following error when using the step_fourier function.
This error only occurs when I use time_series_split split with my data to convert paneled time series into training and testing sets. When I input the dataset directly, the error does…

Mairon Chaves
- 13
- 3
0
votes
0 answers
How to retrieve the coefficients which calculated by rolling lm() function
Using function slidify() in package timetk to create lm_roll(), how to retrieve the coefficients calculated by lm_roll() and calculate slope ? Below code , the last muate can't work . Thanks!
library(timetk)
library(tidyverse)
…

anderwyang
- 1,801
- 4
- 18
0
votes
0 answers
inconsistent week lengths when grouping time series by week using timetk summarise_by_time()
MaxWeekMaxTemp = function(sensor_site = "RAYNER_DOWN.", timeperiod = "6 Days", summstat = mean) {
filtered =temps %>%
filter(site == sensor_site)
filtered$DateTime = as.Date(filtered$DateTime, "%m/%d/%Y")
filtered = filtered %>%
…

Mr.Mellington
- 3
- 2
0
votes
1 answer
Time signatures in timetk package
I'm working with time series data and I'm curious what does week2, week3 and week4 refer to when using tk_augment_timeseries_signature
I'm working with the weekly data (walmart_sales_weekly) from the timetk package:
data_tbl <-…

TheGoat
- 2,587
- 3
- 25
- 58
0
votes
1 answer
My parsnip models doesn't work in modeltime_calibrate function after updating packages
I developed some models for a time series, which was running normally yesterday, but after updating several packages today, including modeltime and timetk packages, the code doesn't work. It seems that the error is in the ranger and xgboost models…

Jean Paul PG
- 3
- 1
0
votes
1 answer
In `timetk` ,the result of function `tk_make_weekend_sequence` show nothing
In timetk ,the result of function tk_make_weekend_sequence show nothing . Anyone can help? Thanks!
library(timetk)
weekends <- tk_make_weekend_sequence(
start_date = "2017-01-01",
end_date = "2017-12-31"
)
weekends

anderwyang
- 1,801
- 4
- 18
0
votes
1 answer
Dealing with Timeseries data set that has not AM/PM and convert to 24 hrs format in R
Let my time series data be
df <- data.frame(timestamp = c('2021-08-11 12:00:00', '2021-08-11 01:00:00', '2021-08-11 02:00:00', '2021-08-11 03:00:00', '2021-08-11 04:00:00', '2021-08-11 05:00:00', '2021-08-11 06:00:00', '2021-08-11 07:00:00',…

Avijit Mallick
- 37
- 1
- 8
0
votes
1 answer
Try to tidy an excel worksheet using R
I am using the following libraries in R:
library(tidyverse)
library(timetk)
library(readxl)
library(writexl)
I have data like this:
structure(list(hour = c("0000", "0100", "0200", "0300", "0400",
"0500", "0600", "0700", "0800", "0900", "1000",…

MCP_infiltrator
- 3,961
- 10
- 45
- 82