{"cells":[{"metadata":{},"cell_type":"markdown","source":"I wrote about Leaderboard probing in [this topic](https://www.kaggle.com/c/osic-pulmonary-fibrosis-progression/discussion/183079). In this notebook, I want to make sure that Patient id has a unique number of 188.\n\nThe following table summarizes the LBscore when all of the FVC and Confidence of the test data are replaced.\n\n|FVC|Confidence|LB score|ref|\n| --- | --- | --- | --- |\n|2000|100|-13.1045|sample_submission.csv|\n|0|0|-24.7981|-|\n|1000|0|-23.0965|-|\n|2000|0|-16.2419|-|\n|3000|0|-17.0911|-|\n|4000|0|-22.5598|-|\n|(test.csv's FVC par patient)|100|-8.1277|[notebook](https://www.kaggle.com/user123454321/sample-submission)|\n\nWe can get the information from LBscore by conditionally branching out and replacing FVC and Confidence with these.\n\n"},{"metadata":{},"cell_type":"markdown","source":"# Leaderboard Probing"},{"metadata":{"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","trusted":true},"cell_type":"code","source":"import pandas as pd\n\nsample_sub = pd.read_csv('../input/osic-pulmonary-fibrosis-progression/sample_submission.csv')\nsample_sub.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"test = sample_sub.copy()\ntest['Patient'] = test['Patient_Week'].apply(lambda x: x.split('_')[0])\n\nif test['Patient'].nunique() == 5:\n    # for Commit\n    sample_sub.to_csv('submission.csv', index=False)\nif test['Patient'].nunique() == 188:\n    # When the unique number of Patients in the test data is 188\n    # set the FVC and Confidence to 0\n    sample_sub['FVC'] = 0\n    sample_sub['Confidence'] = 0\n    sample_sub.to_csv('submission.csv', index=False)\nelse:\n    # Other than 188, does not write out 'submission.csv'\n    pass\n\n# When the LB score is -24.7981, we can see that Patient has 188 uniquenesses.\n   ","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}