{"cells":[{"metadata":{"_uuid":"89b549edd21f78c3f8c9baadce3fffa89d28d638"},"cell_type":"markdown","source":"Take 1, 5 and 10 labels from human labels set and use them for the sample submission. "},{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nimport os\nprint(os.listdir(\"../input\"))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"2be4c1bc0ef263774792f693f6f310c25c212933"},"cell_type":"code","source":"sample_submission_df = pd.read_csv('../input/stage_1_sample_submission.csv', index_col='image_id')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"92f8febbe49914fe47d02ab3e025b08f3f6d6129"},"cell_type":"code","source":"sample_submission_df.head()","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true},"cell_type":"code","source":"labels = pd.read_csv('../input/train_human_labels.csv', index_col='ImageID')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"5a849db67720552b07f0746a2d34d620584f013f"},"cell_type":"code","source":"labels.count()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"0ff7d64dc3faf2ae263f4f905c35683c41276437"},"cell_type":"code","source":"top_5_labels = ' '.join(labels.groupby(['LabelName']).sum().sort_values(['Confidence'], ascending=False).head(5).index.values)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"cc8f9df5c126c52945bd7647326abc62462cbcc2"},"cell_type":"code","source":"top_1_labels = ' '.join(labels.groupby(['LabelName']).sum().sort_values(['Confidence'], ascending=False).head(1).index.values)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"1077d8355de658f9ee3940ded3ae279576510568"},"cell_type":"code","source":"top_10_labels = ' '.join(labels.groupby(['LabelName']).sum().sort_values(['Confidence'], ascending=False).head(10).index.values)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"0b46ac0116a1024014a31be0b1bc03c0d5ba7431"},"cell_type":"code","source":"sample_submission_df['labels'] = top_1_labels\nsample_submission_df.to_csv('top_1_human_labels.csv')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"6d8fb7982f7c6660fbc4b5a25697405b1548e370"},"cell_type":"code","source":"sample_submission_df['labels'] = top_5_labels\nsample_submission_df.to_csv('top_5_human_labels.csv')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"3dfc907f796a64b75edb9b33157bdd349ea688a5"},"cell_type":"code","source":"sample_submission_df['labels'] = top_10_labels\nsample_submission_df.to_csv('top_10_human_labels.csv')","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}