{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"import numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport statsmodels.api as sm\nimport os\nimport scipy.stats as ss\nimport matplotlib.pyplot as plt\nprint(os.listdir(\"../input\"))","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":true},"cell_type":"code","source":"lb = pd.read_csv('../input/imet-leaderboard/imet-2019-fgvc6-publicleaderboard.csv',parse_dates=['SubmissionDate'])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"lb.SubmissionDate.max()","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"The leaderboard-sheet was downloaded in 2019-06-04 13:37:01"},{"metadata":{"trusted":true},"cell_type":"code","source":"team655 = (lb[lb.Score>0.655].TeamId.unique())\nprint(len(team655))","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"There are 19 teams break 0.655 when the leaderboard-sheet was downloaded."},{"metadata":{"trusted":true},"cell_type":"code","source":"lb = lb[lb.Score>0.6]\nlb['score_diff'] = lb['Score'] - lb.groupby('TeamId')['Score'].shift(1)\nlb_team655 = lb[lb.TeamId.isin(team655)]\nlb_team655 = lb_team655.sort_values(by='score_diff',ascending=False)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"lb_team655.groupby('TeamId').head(1)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"In the 19 teams , there are 6 teams which have a score jump >0.04 after they had got 0.6+ score.They are all from ods.ai\n\nIn the 6 teams, there are 5 teams which jump after june 1st（deadline is june 4）. They are all from X5."},{"metadata":{"trusted":true},"cell_type":"code","source":" lb_top_50 = pd.read_csv('../input/imet-leaderboard/lb_score_top50.csv',index_col=[0])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"a = lb_top_50.sort_values(by='diff',ascending=False)\na","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# This is what X5 called as \"normal shakeup\":"},{"metadata":{"trusted":true},"cell_type":"code","source":"X = a['Score_pulblic_when download'][:8].values\nY = np.array([float(i) for i in a.Score_private[:8].values])\nregression_results = sm.OLS(Y, X, missing = \"drop\").fit()\nP_value = regression_results.pvalues [0]\nR_squared = regression_results.rsquared\nK_slope = regression_results.params [0]\nconf_int = regression_results.conf_int ()\nlow_conf_int = conf_int [0][0]\nhigh_conf_int = conf_int [0][1]\nfig, ax = plt.subplots ()\nax.grid (True)\nax.scatter (X, Y, alpha = 1, color='orchid')\nx_pred = np.linspace (min (X), max (X), 40)\ny_pred = regression_results.predict (x_pred)\nax.plot (x_pred, y_pred, '-', color='darkorchid', linewidth=2)\nprint(low_conf_int, high_conf_int)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# While this is what happened to the rest of us....."},{"metadata":{"trusted":true},"cell_type":"code","source":"X = a['Score_pulblic_when download'][8:30].values\nY = np.array([float(i) for i in a.Score_private[8:30].values])\nregression_results = sm.OLS(Y, X, missing = \"drop\").fit()\nP_value = regression_results.pvalues [0]\nR_squared = regression_results.rsquared\nK_slope = regression_results.params [0]\nconf_int = regression_results.conf_int ()\nlow_conf_int = conf_int [0][0]\nhigh_conf_int = conf_int [0][1]\nfig, ax = plt.subplots ()\nax.grid (True)\nax.scatter (X, Y, alpha = 1, color='orchid')\nx_pred = np.linspace (min (X), max (X), 40)\ny_pred = regression_results.predict (x_pred)\nax.plot (x_pred, y_pred, '-', color='darkorchid', linewidth=2)\nprint(low_conf_int, high_conf_int)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"the top 5 teams drop in the private are all from X5.\n\nWhy do those five teams in X5 behave the same way?\n\nThey said the overfit public , how can they overfit public by one jump submission ?"}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.4","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}