{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"markdown","source":"Here I give beginners a lesson about the proper way to create a blend to get a high score.  I see a lot of kernels that are actually blends of blends, and this is for the most part not a good idea.  \n\nA blended solution works best if you **use models that are diverse** as well as give a good score.  So for example, don't blend 2 solutions that both use the same features and the same modeling technique.  A good way to start is to go to the kernels, sort them by best score, then look at each one and find the 2 or 3 top kernels that are not blends themselves.  Preferably choose solutions that use different features and a different modeling approach.  \n\nI did that, and what I see are these 3 amazing kernels:\n\nDistance - is all you need.\nby Sergii\nhttps://www.kaggle.com/criskiev/distance-is-all-you-need-lb-1-481\n\nLGB public kernels plus more features\nby marcelotamashiro \nhttps://www.kaggle.com/marcelotamashiro/lgb-public-kernels-plus-more-features\n\nMPNN\nby fnands\nhttps://www.kaggle.com/fnands/1-mpnn\n\nPlease go and give each of these kernels an upvote.  \n\nThe the next step is to blend their solutions together using a weighted average approach.  There is some trial and error here to determine the best weights to use for each solution.  We have 5 submissions per day here so you have a lot of tries to get the best weights possible.\n\nOnce you download the solutions provided by other folks, the code is trivial."},{"metadata":{"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","trusted":true},"cell_type":"code","source":"import pandas as pd\n\none = pd.read_csv('../input/champs-blending-tutorial/1.csv')\ntwo = pd.read_csv('../input/champs-blending-tutorial/2.csv')\nthree = pd.read_csv('../input/blendsub/submission4.csv')\n\nsubmission = pd.DataFrame()\nsubmission['id'] = one.id\nsubmission['scalar_coupling_constant'] = (0.37*one.scalar_coupling_constant) + (0.37*two.scalar_coupling_constant) + (0.26*three.scalar_coupling_constant)\n\nsubmission.to_csv('super_blend3.csv', index=False)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"markdown","source":"Then just submit and bask in the glory of these other people's work."}],"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":1}