Skip to content

Commit

Permalink
uploaded results up to 7/9/20
Browse files Browse the repository at this point in the history
  • Loading branch information
Weifeng Zhong authored and Weifeng Zhong committed Jul 8, 2020
1 parent 240ccc1 commit 09ad628
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 141 deletions.
Binary file not shown.
Binary file added models/Sentence_based/stage_1_matrix_test.xlsx
Binary file not shown.
Binary file added models/Sentence_based/stage_1_matrix_train.xlsx
Binary file not shown.
Binary file not shown.
Binary file added models/Sentence_based/stage_2_results_test.xlsx
Binary file not shown.
Binary file added models/Sentence_based/stage_2_results_train.xlsx
Binary file not shown.
109 changes: 12 additions & 97 deletions notebook/train_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -29,25 +29,15 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Raw data already present locally.\n",
"Finished processing data.\n",
"Uploaded processed data to s3.\n"
]
}
],
"outputs": [],
"source": [
"model_settings = initialize_model_settings()\n",
"\n",
"\n",
"# get_raw_data(model_settings, \"s3\")\n",
"get_raw_data(model_settings, \"local\") ## If raw data already present locally\n",
"get_raw_data(model_settings, \"s3\")\n",
"# get_raw_data(model_settings, \"local\") ## If raw data already present locally\n",
"\n",
"process_data(model_settings)\n",
"\n",
Expand Down Expand Up @@ -89,84 +79,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Generated train and test data.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\weifeng\\Anaconda3\\envs\\pci_pt\\lib\\site-packages\\torch\\nn\\parallel\\data_parallel.py:26: UserWarning: \n",
" There is an imbalance between your GPUs. You may want to exclude GPU 1 which\n",
" has less than 75% of the memory or cores of GPU 0. You can do so by setting\n",
" the device_ids argument to DataParallel, or by setting the CUDA_VISIBLE_DEVICES\n",
" environment variable.\n",
" warnings.warn(imbalance_warn.format(device_ids[min_pos], device_ids[max_pos]))\n",
" 0%| | 0/160 [00:00<?, ?it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Loaded the requested model\n",
"Forecast: \n",
"- # of obs: 154194\n",
"160 batches\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"161it [16:00, 5.97s/it] \n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Generated train and test data.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\weifeng\\Anaconda3\\envs\\pci_pt\\lib\\site-packages\\torch\\nn\\parallel\\data_parallel.py:26: UserWarning: \n",
" There is an imbalance between your GPUs. You may want to exclude GPU 1 which\n",
" has less than 75% of the memory or cores of GPU 0. You can do so by setting\n",
" the device_ids argument to DataParallel, or by setting the CUDA_VISIBLE_DEVICES\n",
" environment variable.\n",
" warnings.warn(imbalance_warn.format(device_ids[min_pos], device_ids[max_pos]))\n",
" 0%| | 0/109 [00:00<?, ?it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Loaded the requested model\n",
"Forecast: \n",
"- # of obs: 105401\n",
"109 batches\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"110it [10:58, 5.99s/it] \n"
]
}
],
"outputs": [],
"source": [
"for stage in [1, 2]:\n",
"\n",
Expand All @@ -177,11 +92,11 @@
" ## from_s3=True if model is not present locally\n",
" ## from_s3=False if model is present locally\n",
" \n",
"# print(\"Training: \")\n",
"# calc_results(model_settings, stage, model, device, df_train_unbal, \"train\")\n",
" print(\"Training: \")\n",
" calc_results(model_settings, stage, model, device, df_train_unbal, \"train\")\n",
" \n",
"# print(\"Testing: \")\n",
"# calc_results(model_settings, stage, model, device, df_test , \"test\")\n",
" print(\"Testing: \")\n",
" calc_results(model_settings, stage, model, device, df_test , \"test\")\n",
" \n",
" print(\"Forecast: \")\n",
" calc_results(model_settings, stage, model, device, df_forecast, \"forecast\")\n"
Expand All @@ -204,7 +119,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.6.10"
}
},
"nbformat": 4,
Expand Down
55 changes: 18 additions & 37 deletions notebook/visualization.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions notebook/visualization.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ read_model_prediction = function(x){
}
version = "0.1.0"
last_date = as.Date("2020-07-08")
last_date = as.Date("2020-07-09")
```

Expand Down Expand Up @@ -234,9 +234,9 @@ foreach(x = results, j = names(results)) %do% {
legend.position = "bottom",
legend.background=element_blank(),
panel.grid.minor=element_blank(),
panel.grid.major=element_blank()
# axis.title.y.left = element_text(colour = "red"),
# axis.title.y.right = element_text(color = "blue")
panel.grid.major=element_blank(),
axis.title.y.left = element_text(colour = "blue"),
axis.title.y.right = element_text(color = "red")
) +
guides(color = guide_legend(reverse = FALSE))
Expand Down
Binary file added results/PCI-Outbreak_v0.1.0_2020-07-09.xlsx
Binary file not shown.
Binary file added results/pci-outbreak.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/pci-outbreak_w_caption.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/header.r
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ manage_packages = function() {
checkpoint::checkpoint(
checkpointLocation = "~/",
snapshotDate = "2020-05-25",
R.version = "3.6.2"
R.version = "3.6.3"
)

## Import packages
Expand Down
4 changes: 2 additions & 2 deletions src/model_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def initialize_model_settings():

last_date = pd.Timestamp(2020,7,8)
last_date = pd.Timestamp(2020,7,9)

model_settings = {

Expand All @@ -30,7 +30,7 @@ def initialize_model_settings():

'max_length' : 100,
'batch_size' : 24,
'predict_batch_size' : 960,
'predict_batch_size' : 1280,
'epochs' : 20,
'cuda_index' : 0,
'multi_gpu' : True,
Expand Down

0 comments on commit 09ad628

Please sign in to comment.