/ISLR-in-python

Solutions to exercises from An Introduction to Statistical Learning in python as Jupyter Notebooks.

Primary LanguageJupyter NotebookMIT LicenseMIT

ISL-in-python

This repository contains solutions to exercises (Conceptual, Applied) from An Introduction to Statistical Learning with Applications in R, First Edition By Gareth James, Daniela Witten, Trevor Hastie and Rob Tibshirani, writen in Python as Jupyter Notebooks.

You can find the statistic formulas in LaTeX system in each notebook. Each chapter notebook contains an index for each exercise for easier navigation.

There are no official solutions for these questions. These are my Own Answers and may be inccorect. If you spot any mistake/inconsistency, I will be glad if you knock me via Linkedin or at mostaomg@gmail.com 😊

To view notebooks:

Notebooks are in the directory Notebooks

To run notebooks:

  • Running the notebooks enables you to go through and excute the code.
  • Trying, modifying or adding new adjustments.
  • Check/copy the Latex code for each presented formula.

To run Locally:

  1. Install Jupyter Notebooks. I recommend installing Anaconda which make it easier for installing different packages and environments. The software includes everything you would need to run the repository in a smooth environment.
  2. Download the repo from here as a zip file then Extract.
  3. Run jupyter notebook to run the Notebook App server locally on your machine. It should launch in your browser.
  4. In the Notebook App browser, navigate to the repo directory and open the notebook you would like to explore.

To run on google colab:

  • Eduardo Rosas has posted a great blog about Cloning a GitHub repo into Drive from Google Colab here.
  • To summarize the blog in simple two steps:
  1. To access Google Drive from Google Colab, execute this next command on any Colab notebook and follow the link that it will display in the output. You then log in with your Google account, copy the provided key, and paste it back into colab:

    from google.colab import drive
    drive.mount('/content/drive')
  2. Change the Directory to the desired path, and let's say in the main Directory, following by cloning the repo "Copying the repo to the specified Drive path" which is this repo as following:

    %cd /content/drive/MyDrive
    !git clone https://github.com/MostaAshour/ISL-in-python.git

And done! Now you can run the notebooks directly from your Google Drive.