{"cells":[{"metadata":{},"cell_type":"markdown","source":"### What is this?\nThis notebook is to setup indoor-location-navigation dataset quicly for Colab.\n\n### How to use\n- Download this notebook\n- Upload it to Colab\n- Edit YOUR_USER_NAME and YOUR_API_KEY in the 2nd cell.\n- Run :)"},{"metadata":{"id":"BbmPzHjpkoRS","outputId":"7875101d-02a2-4530-b340-6f29810e30f2","trusted":true},"cell_type":"code","source":"!pip uninstall -qy kaggle\n!pip install -Uq kaggle\n!apt-get install -y p7zip-full tree\n!mkdir /root/.kaggle","execution_count":null,"outputs":[]},{"metadata":{"id":"P9NS2CH-kKZ5","outputId":"e86783ba-2258-48d4-b222-2f2adfb03ddf","trusted":true},"cell_type":"code","source":"%%writefile /root/.kaggle/kaggle.json\n{\"username\":\"YOUR_USER_NAME_HERE\",\"key\":\"YOUR_API_KEY_HERE\"}","execution_count":null,"outputs":[]},{"metadata":{"id":"F1-B2AiQkNPx","outputId":"307a6b71-bd81-4e39-cf36-c17c81b76afd","trusted":true},"cell_type":"code","source":"!chmod 600 /root/.kaggle/kaggle.json\n!mkdir -p /kaggle/input/indoor-location-navigation\n!kaggle competitions download -c indoor-location-navigation -p /kaggle/input/indoor-location-navigation","execution_count":null,"outputs":[]},{"metadata":{"id":"g2V487HrkPbG","outputId":"6cd0fbb2-a8fe-4992-9ca4-98fb31ca0e49","trusted":true},"cell_type":"code","source":"!cd /kaggle/input/indoor-location-navigation && time 7z x indoor-location-navigation.zip","execution_count":null,"outputs":[]},{"metadata":{"id":"UNaqCiIKm_hv","outputId":"0ea66c8a-9b4e-4fdc-b911-ae8fb97484a2","trusted":true},"cell_type":"code","source":"!ls /kaggle/input/indoor-location-navigation/train/5a0546857ecc773753327266","execution_count":null,"outputs":[]},{"metadata":{"id":"kr-95pgNtFE2","trusted":true},"cell_type":"code","source":"# number of train data per site.","execution_count":null,"outputs":[]},{"metadata":{"id":"G70ioScwrPF5","outputId":"f965e2aa-948d-476c-c58f-42ba00a4638c","trusted":true},"cell_type":"code","source":"!for i in `ls -1 /kaggle/input/indoor-location-navigation/train/`; do echo -n $i && echo -n ' ' && cd /kaggle/input/indoor-location-navigation/train/$i && find . -type f | wc -l; done","execution_count":null,"outputs":[]},{"metadata":{"id":"IGCofQTEy3ev","trusted":true},"cell_type":"code","source":"# Uniq sites in test dataset.","execution_count":null,"outputs":[]},{"metadata":{"id":"B8ErmaVAr6RJ","outputId":"23df2e86-c847-4752-c5f4-e16105145a7c","trusted":true},"cell_type":"code","source":"from pathlib import Path\nimport re\n\nd = Path('/kaggle/input/indoor-location-navigation/test')\n\nsites = []\n\nfor test_path in d.iterdir():\n  with open(test_path) as f:\n    for line in f:\n      m = re.match(r'.*SiteID:([^\\s]+).*', line)\n      if m:\n        sites.append(m[1])\n        break;\n\nsites = set(sites)\nprint(f'site={len(sites)}')\nsites","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}