{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\n\"\"\" \ndisable the below code,since there are a lot of files in the folde\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\"\"\"\n\n# You can write up to 5GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"This notebook copies for my personal use and modify.\n\nfrom https://www.kaggle.com/muhakabartay/simple-public-blender-0-930\n\nThe data is added from \n\nhttps://www.kaggle.com/muhakabartay/melanoma-public\n\nPlease UPVOTE the original kernels if you find it useful","execution_count":null},{"metadata":{"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","trusted":true},"cell_type":"code","source":"from pathlib import Path\n\nsub_path = Path(\"../input/melanoma-public\")\nsub_866_path = sub_path/'submission_866.csv'\nsub_877_path = sub_path/'submission_877.csv'\nsub_879_path = sub_path/'submission_879.csv'\nsub_884_path = sub_path/'submission_884.csv'\nsub_892_path = sub_path/'submission_892.csv'\nsub_897_path = sub_path/'submission_897.csv'\nsub_910_path = sub_path/'submission_910.csv'\nsub_914_path = sub_path/'submission_914.csv'\nsub_927_path = sub_path/'submission_927.csv'\n\nsub_866 = pd.read_csv(sub_866_path)\nsub_877 = pd.read_csv(sub_877_path)\nsub_879 = pd.read_csv(sub_879_path)\nsub_884 = pd.read_csv(sub_884_path)\nsub_892 = pd.read_csv(sub_892_path)\nsub_897 = pd.read_csv(sub_897_path)\nsub_910 = pd.read_csv(sub_910_path)\nsub_914 = pd.read_csv(sub_914_path)\nsub_927 = pd.read_csv(sub_927_path)\n\nsub_866 = sub_866.sort_values(by=\"image_name\")\nsub_877 = sub_877.sort_values(by=\"image_name\")\nsub_879 = sub_879.sort_values(by=\"image_name\")\nsub_884 = sub_884.sort_values(by=\"image_name\")\nsub_892 = sub_892.sort_values(by=\"image_name\")\nsub_897 = sub_897.sort_values(by=\"image_name\")\nsub_910 = sub_910.sort_values(by=\"image_name\")\nsub_914 = sub_914.sort_values(by=\"image_name\")\nsub_927 = sub_927.sort_values(by=\"image_name\")\n\nout1 = sub_866[\"target\"].astype(float).values\nout2 = sub_877[\"target\"].astype(float).values\nout3 = sub_879[\"target\"].astype(float).values\nout4 = sub_884[\"target\"].astype(float).values\nout5 = sub_892[\"target\"].astype(float).values\nout6 = sub_897[\"target\"].astype(float).values\nout7 = sub_910[\"target\"].astype(float).values\nout8 = sub_914[\"target\"].astype(float).values\nout9 = sub_927[\"target\"].astype(float).values","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"merge_output = []\nn=9\n\n# Dummy weights, find your strategy!\nw1 = 0.02\nw2 = 0.03\nw3 = 0.03\nw4 = 0.04\nw5 = 0.06\nw6 = 0.14\nw7 = 0.19\nw8 = 0.22\nw9 = 0.27\n\nprint('Sum weights:',w1+w2+w3+w4+w5+w6+w7+w8+w9)\n\n\nfor o1, o2, o3, o4, o5, o6, o7, o8, o9 in zip(out1, out2, out3, out4, out5, out6, out7, out8, out9):\n    #print(o1,type(o1))\n    o = float((o1*w1 + o2*w2 + o3*w3 + o4*w4 + o5*w5 + o6*w6 + o7*w7 + o8*w8 + o9*w9)/n)\n    merge_output.append(o)\n    \nsub_866[\"target\"] = merge_output\nsub_866[\"target\"] = sub_866[\"target\"].astype(float)\n#sub_866 = sub_866.drop(['index'], axis=1)\nsub_866.to_csv(\"submission_simple_bleding1.csv\", index=False)\n\nsub_866.head(3)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# Dummy weights, find your strategy!\nmerge_output2 = []\nw1 = 0.03\nw2 = 0.03\nw3 = 0.03\nw4 = 0.05\nw5 = 0.05\nw6 = 0.15\nw7 = 0.20\nw8 = 0.21\nw9 = 0.25\n\nprint('Sum weights:',w1+w2+w3+w4+w5+w6+w7+w8+w9)\n\n\nfor o1, o2, o3, o4, o5, o6, o7, o8, o9 in zip(out1, out2, out3, out4, out5, out6, out7, out8, out9):\n    #print(o1,type(o1))\n    o = float((o1*w1 + o2*w2 + o3*w3 + o4*w4 + o5*w5 + o6*w6 + o7*w7 + o8*w8 + o9*w9)/n)\n    merge_output2.append(o)\n    \nsub_877[\"target\"] = merge_output\nsub_877[\"target\"] = sub_877[\"target\"].astype(float)\nsub_877.to_csv(\"submission_simple_bleding2.csv\", index=False)\n\nsub_877.head(3)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# Dummy weights, find your strategy!\nmerge_output3 = []\nw1 = 0.1\nw2 = 0.1\nw3 = 0.1\nw4 = 0.1\nw5 = 0.1\nw6 = 0.1\nw7 = 0.1\nw8 = 0.15\nw9 = 0.15\n\nprint('Sum weights:',w1+w2+w3+w4+w5+w6+w7+w8+w9)\n\n\nfor o1, o2, o3, o4, o5, o6, o7, o8, o9 in zip(out1, out2, out3, out4, out5, out6, out7, out8, out9):\n    #print(o1,type(o1))\n    o = float((o1*w1 + o2*w2 + o3*w3 + o4*w4 + o5*w5 + o6*w6 + o7*w7 + o8*w8 + o9*w9)/n)\n    merge_output3.append(o)\n    \nsub_866[\"target\"] = merge_output\nsub_866[\"target\"] = sub_877[\"target\"].astype(float)\nsub_866.to_csv(\"submission_simple_bleding3.csv\", index=False)\n\nsub_866.head(3)","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":4}