{"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"import pandas as pd\nimport os\nDATA_DIR = '../input/siim-isic-melanoma-classification/'\n\ntrain = pd.read_csv(os.path.join(DATA_DIR, 'train.csv'))\ntrain.shape","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"test = pd.read_csv(os.path.join(DATA_DIR, 'test.csv'))\ntest.shape","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"total = test.shape[0]\npositive = round(total * train.target.mean())","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"from sklearn.metrics import roc_auc_score","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# 000...00011..11\nroc_auc_score([0] * (total - positive) + [1] * (positive), range(total))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# 11..11000...000\nroc_auc_score([0] * (total - positive) + [1] * (positive), range(total)[::-1])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# 00...011..110\nroc_auc_score([0] * (total - positive) + [1] * (positive), [total - 1] + list(range(total - 1))) ","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# 10...0011..11\n(roc_auc_score([0] * (total - positive) + [1] * (positive), list(range(total - 1)) + [-1]))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# 110...0011..1\n(roc_auc_score([0] * (total - positive) + [1] * (positive), list(range(total - 2)) + [-2, -1]))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# 1110...0011..1\n(roc_auc_score([0] * (total - positive) + [1] * (positive), list(range(total - 3)) + list(range(-3, 0))))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# 0...01010101010..101\n(roc_auc_score([0] * (total - positive * 2) + [0, 1] * (positive), range(total)))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"# 0...000001001001001001..001001\n(roc_auc_score([0] * (total - positive * 3) + [0, 0, 1] * (positive), range(total)))","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}