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

Add helper tags to mrdgp and svgp script #655

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 61 additions & 23 deletions containers/scripts/mrdgp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,67 @@
# exit when any command fails
set -e

# set the secretfile filepath (if on own machine, use 'init production' to write to the production database)
urbanair init local --secretfile "$DB_SECRET_FILE"

# generate the data config
urbanair model data generate-config \
--trainupto yesterday \
--traindays 3 \
--preddays 2 \
--static-features total_road_length \
--static-features flat \
--feature-buffer 500 \
--train-source laqn \
--train-source satellite \
--pred-source laqn \
--pred-source hexgrid \
--species NO2 \
--overwrite

# check the data exists in the DB
urbanair model data generate-full-config

# download the data using the config
urbanair model data download --training-data --prediction-data --output-csv
#default values
LOCAL=0
DOWNLOAD_DATA=1

#handle input flags
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--local)
LOCAL=1
shift # past argument
;;
--no-download)
DOWNLOAD_DATA=0
shift # past argument
;;
--help)
HELP=1
shift # past argument
;;
esac
done

if [ "$HELP" == '1' ]; then
echo 'Help:'
echo ' --local : Run locally'
echo ' --no-download : Do not re-download data'
exit
fi


# set the secretfile filepath
if [ "$LOCAL" == '0' ]; then
urbanair init local --secretfile "$DB_SECRET_FILE"
else
urbanair init production
fi

if [ "$DOWNLOAD_DATA" == '1' ]; then
# generate the data config
urbanair model data generate-config \
--trainupto yesterday \
--traindays 3 \
--preddays 2 \
--static-features total_road_length \
--static-features flat \
--feature-buffer 500 \
--train-source laqn \
--train-source satellite \
--pred-source laqn \
--pred-source hexgrid \
--species NO2 \
--overwrite

# check the data exists in the DB
urbanair model data generate-full-config

# download the data using the config
urbanair model data download --training-data --prediction-data --output-csv
fi

# create the model parameters
urbanair model setup mrdgp --maxiter 5000 --num-inducing-points 500
Expand Down
85 changes: 61 additions & 24 deletions containers/scripts/svgp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,67 @@
# exit when any command fails
set -e

# set the secretfile filepath (if on own machine, use 'init production' to write to the production database)
urbanair init local --secretfile "$DB_SECRET_FILE"

# generate the data config
urbanair model data generate-config \
--trainupto yesterday \
--traindays 5 \
--preddays 2 \
--train-source laqn \
--pred-source laqn \
--pred-source hexgrid \
--species NO2 \
--static-features total_a_road_length \
--dynamic-features max_n_vehicles \
--dynamic-features avg_n_vehicles \
--feature-buffer 500 \
--feature-buffer 100 \
--overwrite

# check the data exists in the DB
urbanair model data generate-full-config

# download the data using the config
urbanair model data download --training-data --prediction-data --output-csv
#default values
LOCAL=0
DOWNLOAD_DATA=1

#handle input flags
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--local)
LOCAL=1
shift # past argument
;;
--no-download)
DOWNLOAD_DATA=0
shift # past argument
;;
--help)
HELP=1
shift # past argument
;;
esac
done

if [ "$HELP" == '1' ]; then
echo 'Help:'
echo ' --local : Run locally'
echo ' --no-download : Do not re-download data'
exit
fi

# set the secretfile filepath
if [ "$LOCAL" == '0' ]; then
urbanair init local --secretfile "$DB_SECRET_FILE"
else
urbanair init production
fi

if [ "$DOWNLOAD_DATA" == '1' ]; then
# generate the data config
urbanair model data generate-config \
--trainupto yesterday \
--traindays 5 \
--preddays 2 \
--train-source laqn \
--pred-source laqn \
--pred-source hexgrid \
--species NO2 \
--static-features total_a_road_length \
--dynamic-features max_n_vehicles \
--dynamic-features avg_n_vehicles \
--feature-buffer 500 \
--feature-buffer 100 \
--overwrite

# check the data exists in the DB
urbanair model data generate-full-config

# download the data using the config
urbanair model data download --training-data --prediction-data --output-csv
fi

# Optionally save the data to a different directory
# urbanair model data save-cache [name of directory]
Expand Down