Skip to content

Commit

Permalink
Speed up vignettes, change copyright format for CRAN, remove donttest…
Browse files Browse the repository at this point in the history
… in examples
  • Loading branch information
nredell committed Oct 1, 2019
1 parent 339c50e commit 03d6770
Show file tree
Hide file tree
Showing 25 changed files with 69 additions and 205 deletions.
23 changes: 2 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,2 @@
MIT License

Copyright (c) 2019 Nickalus Redell

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
YEAR: 2019
COPYRIGHT HOLDER: Nickalus Redell
23 changes: 2 additions & 21 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,2 @@
# MIT License

Copyright (c) 2019 Nickalus Redell

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
YEAR: 2019
COPYRIGHT HOLDER: Nickalus Redell
2 changes: 0 additions & 2 deletions R/examples/example_create_lagged_df.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
\donttest{
# Sampled Seatbelts data from the R package datasets.
data("data_seatbelts", package = "forecastML")
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -26,4 +25,3 @@ data_train <- create_lagged_df(data_seatbelts, type = "train", outcome_cols = 1,
lookback_control = lookback, horizon = horizons)
head(data_train[[length(horizons)]])
#------------------------------------------------------------------------------
}
2 changes: 0 additions & 2 deletions R/examples/example_create_windows.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
\donttest{
# Sampled Seatbelts data from the R package datasets.
data("data_seatbelts", package = "forecastML")

Expand All @@ -10,4 +9,3 @@ data_train <- create_lagged_df(data_seatbelts, type = "train", outcome_cols = 1,
lookback = lookback, horizon = horizons)

create_windows(data_train, window_length = 12)
}
31 changes: 14 additions & 17 deletions R/examples/example_fill_gaps.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
\donttest{
# NOAA buoy dataset with gaps in data collection
data("data_buoy_gaps", package = "forecastML")

# NOAA buoy dataset with gaps in data collection
data("data_buoy_gaps", package = "forecastML")
data_buoy_no_gaps <- fill_gaps(data_buoy_gaps, date_col = 1, frequency = '1 day',
groups = 'buoy_id', static_features = c('lat', 'lon'))

data_buoy_no_gaps <- fill_gaps(data_buoy_gaps, date_col = 1, frequency = '1 day',
groups = 'buoy_id', static_features = c('lat', 'lon'))
# The returned data.frame has the same number of columns but the time-series
# are now evenly spaced at 1 day apart. Additionally, the unchanging grouping
# columns and static features columns have been filled in for the newly created dataset rows.
dim(data_buoy_gaps)
dim(data_buoy_no_gaps)

# The returned data.frame has the same number of columns but the time-series
# are now evenly spaced at 1 day apart. Additionally, the unchanging grouping
# columns and static features columns have been filled in for the newly created dataset rows.
dim(data_buoy_gaps)
dim(data_buoy_no_gaps)

# Running create_lagged_df() is the next step in the forecastML forecasting
# process. If there are long gaps in data collection, like in this buoy dataset,
# and the user-supplied modeling algorithm cannot handle missing outcomes data,
# the best option is to filter these rows out in the user-supplied modeling function
# for train_model()
}
# Running create_lagged_df() is the next step in the forecastML forecasting
# process. If there are long gaps in data collection, like in this buoy dataset,
# and the user-supplied modeling algorithm cannot handle missing outcomes data,
# the best option is to filter these rows out in the user-supplied modeling function
# for train_model()
3 changes: 0 additions & 3 deletions R/examples/example_plot_lagged_df.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
\donttest{
# Sampled Seatbelts data from the R package datasets.
data("data_seatbelts", package = "forecastML")
#------------------------------------------------------------------------------
Expand All @@ -17,5 +16,3 @@ lookback <- list(c(3, 6, 9, 12), c(4:12), c(6:15), c(8))
data_train <- create_lagged_df(data_seatbelts, type = "train", outcome_cols = 1,
lookback_control = lookback, horizon = horizons)
plot(data_train)
#------------------------------------------------------------------------------
}
2 changes: 0 additions & 2 deletions R/examples/example_plot_windows.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
\donttest{
# Sampled Seatbelts data from the R package datasets.
data("data_seatbelts", package = "forecastML")

Expand All @@ -12,4 +11,3 @@ data_train <- create_lagged_df(data_seatbelts, type = "train", outcome_cols = 1,
windows <- create_windows(data_train, window_length = 12)

plot(windows, data_train)
}
2 changes: 0 additions & 2 deletions R/examples/example_predict_train_model.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
\donttest{
# Sampled Seatbelts data from the R package datasets.
data("data_seatbelts", package = "forecastML")

Expand Down Expand Up @@ -57,4 +56,3 @@ data_forecast <- create_lagged_df(data_seatbelts, type = "forecast", outcome_col

data_forecasts <- predict(model_results, prediction_function = list(prediction_function),
data = data_forecast)
}
2 changes: 0 additions & 2 deletions R/examples/example_return_error.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
\donttest{
# Sampled Seatbelts data from the R package datasets.
data("data_seatbelts", package = "forecastML")

Expand Down Expand Up @@ -53,4 +52,3 @@ data_valid <- predict(model_results, prediction_function = list(prediction_funct

# Forecast error metrics for validation datasets.
data_error <- return_error(data_valid)
}
2 changes: 0 additions & 2 deletions R/examples/example_return_hyper.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
\donttest{
# Sampled Seatbelts data from the R package datasets.
data("data_seatbelts", package = "forecastML")

Expand Down Expand Up @@ -70,4 +69,3 @@ data_hyper <- return_hyper(model_results, hyper_function)

plot(data_hyper, data_valid, data_error, type = "stability",
horizons = c(1, 12))
}
2 changes: 0 additions & 2 deletions R/examples/example_train_model.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
\donttest{
# Sampled Seatbelts data from the R package datasets.
data("data_seatbelts", package = "forecastML")

Expand Down Expand Up @@ -35,4 +34,3 @@ model_results <- train_model(data_train, windows, model_name = "LASSO", model_fu
# View the results for the model (a) trained on the first horizon
# and (b) to be assessed on the first outer-loop validation window.
model_results$horizon_1$window_1$model
}
2 changes: 0 additions & 2 deletions man/create_lagged_df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions man/create_windows.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 14 additions & 17 deletions man/fill_gaps.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions man/plot.forecast_model_hyper.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions man/plot.lagged_df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions man/plot.windows.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions man/predict.forecast_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions man/return_error.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions man/return_hyper.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions man/train_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/custom_functions.Rmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Customizing Wrapper Functions"
author: "Nickalus Redell, nickalusredell@gmail.com"
author: "Nickalus Redell"
date: "`r lubridate::today()`"
output: rmarkdown::html_vignette
vignette: >
Expand Down
Loading

0 comments on commit 03d6770

Please sign in to comment.