{"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_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"<a id=\"intro\"></a>\n# <b><span style='color:#006241;font-size:300%'>1 |</span><span style='color:#006241;font-size:300%'> INTRODUCTION</span></b>\nRequired packages for [PyCaret💎][1] are archived in the notebook. You can install [PyCaret💎][1] to internet disabled notebook and play dataset super-easily!\n\nCheck out [\"A PyCaret💎 Model to Predict Student Performance🤣\"][2], if you want to example to build classification model for [\"Predict Student Performance from Game Play\"][3] with [PyCaret💎][1]!! It is a easy-to-read notebook in few 10 minites.\n\n\n[1]: https://pycaret.org/\n[2]: https://www.kaggle.com/acchiko/a-pycaret-model-to-predict-student-performance\n[3]: https://www.kaggle.com/competitions/predict-student-performance-from-game-play","metadata":{}},{"cell_type":"markdown","source":"<a id=\"how_to_use\"></a>\n# <b><span style='color:#006241;font-size:150%'>1-1 |</span><span style='color:#006241;font-size:150%'> How to use</span></b>\nFollow the steps to install [PyCaret💎][1] to your internet disabled notebook,\n- Add the notebook output to your notebook,\n  - \"File\" --> \"Add data\" --> Search & Select the notebook --> \"Add Dataset\"\n- Extract archive,\n  - !tar xvjf {path_to_archive} {path_to_packages}\n- Install [PyCaret💎][1] from local packages.\n  - !pip install --no-index --find-links={path_to_packages} pycaret\n\n\n[1]: https://pycaret.org/","metadata":{}},{"cell_type":"markdown","source":"<a id=\"intro\"></a>\n# <b><span style='color:#006241;font-size:300%'>2 |</span><span style='color:#006241;font-size:300%'> PACKAGES FOR PYCARET</span></b>","metadata":{}},{"cell_type":"markdown","source":"<a id=\"download_packages\"></a>\n# <b><span style='color:#006241;font-size:150%'>2-1 |</span><span style='color:#006241;font-size:150%'> Download packages</span></b>\nDownload all packages for [PyCaret💎][1](latest ver. 3.0.2).\n\n\n[1]: https://pycaret.org/","metadata":{}},{"cell_type":"code","source":"# Create directory to save packages.\npath_to_dir_packages = \"./packages\"\n!mkdir -p {path_to_dir_packages}","metadata":{"execution":{"iopub.status.busy":"2023-06-23T08:05:29.988266Z","iopub.execute_input":"2023-06-23T08:05:29.989443Z","iopub.status.idle":"2023-06-23T08:05:31.111448Z","shell.execute_reply.started":"2023-06-23T08:05:29.989403Z","shell.execute_reply":"2023-06-23T08:05:31.109938Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Download packages for PyCaret.\n!pip download pycaret -d {path_to_dir_packages}\n!pip download poetry-core -d {path_to_dir_packages}\n!pip download oldest-supported-numpy -d {path_to_dir_packages}","metadata":{"execution":{"iopub.status.busy":"2023-06-23T08:05:31.113590Z","iopub.execute_input":"2023-06-23T08:05:31.114681Z","iopub.status.idle":"2023-06-23T08:06:26.446896Z","shell.execute_reply.started":"2023-06-23T08:05:31.114640Z","shell.execute_reply":"2023-06-23T08:06:26.445443Z"},"scrolled":true,"_kg_hide-output":true,"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<a id=\"download_packages\"></a>\n# <b><span style='color:#006241;font-size:150%'>2-2 |</span><span style='color:#006241;font-size:150%'> Test packages</span></b>\nInstall [PyCaret💎][1] from downloaded packages. Then try classification to make sure that there is no proplem.\n\n\n[1]: https://pycaret.org/","metadata":{}},{"cell_type":"code","source":"# Install PyCaret from downloaded packages.\n!pip install --no-index --find-links=packages pycaret","metadata":{"execution":{"iopub.status.busy":"2023-06-23T08:06:26.448499Z","iopub.execute_input":"2023-06-23T08:06:26.448889Z","iopub.status.idle":"2023-06-23T08:07:12.953553Z","shell.execute_reply.started":"2023-06-23T08:06:26.448852Z","shell.execute_reply":"2023-06-23T08:07:12.952075Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Try to load sample dataset and perform classification.\nfrom pycaret.datasets import get_data\nfrom pycaret.classification import ClassificationExperiment\n\ndata = get_data(\"diabetes\")\ns = ClassificationExperiment()\ns.setup(data, target=\"Class variable\", session_id=123)\nbest = s.compare_models()","metadata":{"execution":{"iopub.status.busy":"2023-06-23T08:07:12.956741Z","iopub.execute_input":"2023-06-23T08:07:12.957149Z","iopub.status.idle":"2023-06-23T08:08:16.438236Z","shell.execute_reply.started":"2023-06-23T08:07:12.957114Z","shell.execute_reply":"2023-06-23T08:08:16.436842Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<a id=\"save_packages\"></a>\n# <b><span style='color:#006241;font-size:150%'>2-3 |</span><span style='color:#006241;font-size:150%'> Save packages</span></b>\nCompress downloaded packages for later use. We can re-use the packages to install [PyCaret][1] in the other internet disabled notebook.\n\n[1]: https://pycaret.org/","metadata":{}},{"cell_type":"code","source":"# Compress downloaded packages.\nimport os\npath_to_archive = f\"{os.path.basename(path_to_dir_packages)}.tar.bz2\"\n!tar cvjf {path_to_archive} {path_to_dir_packages}\n!rm -rf {path_to_dir_packages}","metadata":{"execution":{"iopub.status.busy":"2023-06-23T08:08:16.439779Z","iopub.execute_input":"2023-06-23T08:08:16.440202Z","iopub.status.idle":"2023-06-23T08:09:29.009996Z","shell.execute_reply.started":"2023-06-23T08:08:16.440146Z","shell.execute_reply":"2023-06-23T08:09:29.008252Z"},"collapsed":true,"jupyter":{"outputs_hidden":true},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# Print list of output files.\n!ls","metadata":{"execution":{"iopub.status.busy":"2023-06-23T08:09:29.012108Z","iopub.execute_input":"2023-06-23T08:09:29.012553Z","iopub.status.idle":"2023-06-23T08:09:30.114975Z","shell.execute_reply.started":"2023-06-23T08:09:29.012513Z","shell.execute_reply":"2023-06-23T08:09:30.113445Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<a id=\"thanks\"></a>\n# <b><span style='color:#006241;font-size:600%'> THANK You for Reading🤣!!</span></b>\n<b><span style='color:#006241;font-size:300%'> Please UPVOTE If You Iike😍 It.</span></b>","metadata":{}}]}