{"id":22166639,"url":"https://github.com/alextanhongpin/data-science-learn","last_synced_at":"2025-04-10T18:51:41.510Z","repository":{"id":79114789,"uuid":"187480114","full_name":"alextanhongpin/data-science-learn","owner":"alextanhongpin","description":"Things I learn about data science","archived":false,"fork":false,"pushed_at":"2023-09-27T01:17:00.000Z","size":8406,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T16:37:46.354Z","etag":null,"topics":["clustering","data-science","machine-learning","naive-bayes","python","statistic"],"latest_commit_sha":null,"homepage":null,"language":"Roff","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alextanhongpin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-19T13:27:01.000Z","updated_at":"2025-02-05T18:15:33.000Z","dependencies_parsed_at":"2023-09-27T06:45:00.915Z","dependency_job_id":null,"html_url":"https://github.com/alextanhongpin/data-science-learn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fdata-science-learn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fdata-science-learn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fdata-science-learn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextanhongpin%2Fdata-science-learn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alextanhongpin","download_url":"https://codeload.github.com/alextanhongpin/data-science-learn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248274189,"owners_count":21076322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clustering","data-science","machine-learning","naive-bayes","python","statistic"],"created_at":"2024-12-02T05:20:16.031Z","updated_at":"2025-04-10T18:51:41.489Z","avatar_url":"https://github.com/alextanhongpin.png","language":"Roff","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Science Learn\n\nLearn basic data science through trial and error.\n\n## Starting the Juptyer Notebook\n\nRuns a Jupyter Notebook in a Docker container with persistent volume.\n\n```bash\n$ docker run -p 8888:8888 -v $PWD:/home/jovyan/work jupyter/base-notebook\n```\n\n\n## References\n\nMathematics for machine learning:\n\nhttps://mml-book.github.io/book/mml-book.pdf\n\n\n## Running tests in jupyter notebook/jupyter lab\n\n```python\nif __name__ == '__main__':\n    unittest.main(argv=['first-arg-is-ignored'], exit=False)\n```\n\n## Jupyterlab error starting kernel\n\n```bash\n$ python -m ipykernel install --user\n```\n\n\n## Jupyterlab shortcuts rename file\n\n`Command + r` for renaming:\n```json\n{\n        \"shortcuts\": [\n            {\n                \"command\": \"docmanager:rename\",\n                \"keys\": [\n                    \"Accel R\"\n                ],\n                \"selector\": \"body\"\n            }\n        ]\n}\n```\n\n## Jupyter running command with python variables\n\n```py\nname = 'john doe'\n!echo {name}\n```\n\n## Jupyter right way of installing modules\n\nBad:\n```python\n!pip3 install module\n```\n\nGood:\n```python\nimport sys\n!{sys.executable} -m pip install spacy\n!{sys.executable} -m spacy download en_core_web_sm\n```\n\n## Installing Jupytext\n\nAllows the notebook to be saved as markdown:\n```bash\n$ brew install jupyterlab\n$ pip install jupytext\n$ jupyter labextension install jupyterlab-jupytext\n```\n\n## Add code formatting for Jupyter\nhttps://jupyterlab-code-formatter.readthedocs.io/en/latest/\n\n# Git\nhttps://www.wrighters.io/version-control-for-jupyter-notebooks/\n\n### recommendation with dbscan\n\nhttps://www.datacamp.com/community/tutorials/dbscan-macroscopic-investigation-python\n\n\n## Fetching CSV data from Github using Jupyter\n\nUseful for Google Colab/Kaggle:\n\n```\n!mkdir data\n!ls data\n!curl -L https://github.com/alextanhongpin/blueprints-for-text-analytics-python/blob/master/data/abcnews-date-text.csv.gz?raw=true -o data/abcnews-date-text.csv.gz\nimport pandas as pd \n```\n\n## Jupyterlab Plot\n\n```\n!pip install ipympl\n%matplotlib widget\n```\n\nAlternative, which is better:\n\n```\nimport matplotlib.pyplot as plt\nplt.rcParams[\"figure.figsize\"] = (20, 10)\n```\n\n\n## Upgrade all pip modules\n\n```bash\n$ pip3 list --outdated --format=freeze | grep -v '^\\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextanhongpin%2Fdata-science-learn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falextanhongpin%2Fdata-science-learn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextanhongpin%2Fdata-science-learn/lists"}