Skip to content

Commit

Permalink
notes from convo with Nate and Noam
Browse files Browse the repository at this point in the history
  • Loading branch information
emmamendelsohn committed Jun 4, 2024
1 parent ff6c4da commit e7dbcec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions R/model_recipe.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
model_recipe <- function(training_data) {

recipe(formula = as.formula(outbreak_30 ~
# TODO add day of year
# TODO add static
# TODO add immunity layer
# TODO add recent outbreak layer - has there been an outbreak this season
anomaly_relative_humidity_30 +
anomaly_temperature_30 +
anomaly_precipitation_30 +
Expand Down
11 changes: 6 additions & 5 deletions _targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ dynamic_targets <- tar_plan(

# project to the template and save as parquets (these can now be queried for analysis)
# this maintains the branches, saves separate files split by date
# TODO NAs outside of the continent

tar_target(sentinel_ndvi_transformed,
transform_sentinel_ndvi(sentinel_ndvi_downloaded,
continent_raster_template,
Expand Down Expand Up @@ -164,7 +164,7 @@ dynamic_targets <- tar_plan(

# project to the template and save as parquets (these can now be queried for analysis)
# this maintains the branches, saves separate files split by date
# TODO NAs outside of the continent

tar_target(modis_ndvi_transformed,
transform_modis_ndvi(modis_ndvi_downloaded_subset,
continent_raster_template,
Expand Down Expand Up @@ -229,7 +229,7 @@ dynamic_targets <- tar_plan(
cue = tar_cue(tar_cue_general)),

# project to the template and save as arrow dataset
# TODO NAs outside of the continent

tar_target(nasa_weather_transformed,
transform_nasa_weather(nasa_weather_pre_transformed,
nasa_weather_transformed_directory,
Expand Down Expand Up @@ -281,7 +281,8 @@ dynamic_targets <- tar_plan(
cue = tar_cue(tar_cue_upload_aws)), # only run this if you need to upload new data

# project to the template and save as arrow dataset
# TODO NAs outside of the continent

# TODO add grib_ls
tar_target(ecmwf_forecasts_transformed,
transform_ecmwf_forecasts(ecmwf_forecasts_downloaded,
ecmwf_forecasts_transformed_directory,
Expand Down Expand Up @@ -550,7 +551,7 @@ model_targets <- tar_plan(
# xgboost settings
tar_target(base_score, sum(training_data$outbreak_30==TRUE)/nrow(training_data)),
tar_target(interaction_constraints, '[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], [15]]'), # area is the 16th col in rec_juiced
tar_target(monotone_constraints, c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)),
tar_target(monotone_constraints, c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)), # enforce positive relationship for area

# tuning
tar_target(spec, model_specs(base_score, interaction_constraints, monotone_constraints)),
Expand Down

0 comments on commit e7dbcec

Please sign in to comment.