forked from bcaitech1/p4-dkt-team-ikyo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1327306
commit 8ce06a9
Showing
22 changed files
with
4,993 additions
and
4,192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "343ee127-66d1-48cd-a207-3f5ddba915cc", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"['/opt/ml/code/output/pjh_0.7312_0.7911.csv', '/opt/ml/code/output/output6_19_17_30.csv', '/opt/ml/code/output/hk_auc8285_acc7554.csv', '/opt/ml/code/output/output_7975.csv']\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# 평균\n", | ||
"from glob import glob\n", | ||
"import pandas as pd\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"import seaborn as sns\n", | ||
"plt.style.use('fivethirtyeight')\n", | ||
"\n", | ||
"%matplotlib inline\n", | ||
"\n", | ||
"output_path = \"/opt/ml/code/output/cross_validation/output.csv\"\n", | ||
"csv_file_path_list = glob(\"/opt/ml/code/output/*.csv\")\n", | ||
"print(csv_file_path_list)\n", | ||
"\n", | ||
"POWER = 1/4\n", | ||
"\n", | ||
"# concat result dataframe\n", | ||
"result = pd.read_csv(csv_file_path_list[0])[\"prediction\"]\n", | ||
"result = result ** POWER\n", | ||
"for csv_file_path in csv_file_path_list[1:]:\n", | ||
" temp_result = pd.read_csv(csv_file_path)[\"prediction\"]\n", | ||
" temp_result = temp_result ** POWER\n", | ||
" result = pd.concat([result, temp_result], axis=1)\n", | ||
"\n", | ||
"# mean result dataframe\n", | ||
"result = pd.DataFrame(result.mean(axis=1)).reset_index().rename(columns = {0:\"prediction\", \"index\":\"id\"})\n", | ||
"result.to_csv(output_path, index=False)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.7.7" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.