← 开源

Solutions to labs and excercises from An Introduction to Statistical Learning, as Jupyter Notebooks.

TutorialsML/AI fundamentalsJupyter Notebook
增长势头
+024 小时新增 Star0.0%
359
Star
125
Fork
+0
本周
1
贡献者
创建于 2018-10-31 · 更新于 2026-11-19 · 今日第 24700 名
主要开发者
README

ISL-python

An Introduction to Statistical Learning is a textbook by Gareth James, Daniela Witten, Trevor Hastie and Robert Tibshirani. Conceptual and applied exercises are provided at the end of each chapter covering supervised learning.

This repository contains my solutions to the labs and exercises as Jupyter Notebooks written in Python using:

  • Numpy
  • Pandas
  • Matplotlib
  • Seaborn
  • Patsy
  • StatsModels
  • Sklearn

Perhaps of most interest will be the recreation of some functions from the R language that I couldn't find in the Python ecosystem. These took me some time to reproduce but the implementation details are not essential to the concepts taught in the book so please feel free to reuse. For example, a reproduction of R's lm() four-way diagnostic plot for linear regression in Chapter 3. Also, a collection of all required datasets is provided in .csv format.

To view notebooks

Links to view each notebook below. The code is provided here.

Chapter 2 - Statistical Learning: Conceptual
Chapter 2 - Statistical Learning: Applied

Chapter 3 - Linear Regression: Conceptual
Chapter 3 - Linear Regression: Applied

Chapter 4 - Classification: Conceptual
Chapter 4 - Classification: Applied

Chapter 5 - Resampling Methods: Conceptual
Chapter 5 - Resampling Methods: Applied

Chapter 6 - Linear Model Selection and Regularization: Labs
Chapter 6 - Linear Model Selection and Regularization: Conceptual
Chapter 6 - Linear Model Selection and Regularization: Applied

Chapter 7 - Moving Beyond Linearity: Labs
Chapter 7 - Moving Beyond Linearity: Applied

Chapter 8 - Tree-Based Methods: Labs
Chapter 8 - Tree-Based Methods: Conceptual
Chapter 8 - Tree-Based Methods: Applied

Chapter 9 - Support Vector Machines: Labs
Chapter 9 - Support Vector Machines: Conceptual
Chapter 9 - Support Vector Machines: Applied

To run notebooks

Running the notebooks enables you to execute the code and play around with any interactive features.

To run:

  1. Install Jupyter Notebooks. I recommend doing this via the Annaconda/Conda method to ensure that package versions play nicely together.
  2. cd to this repo
  3. Run jupyter notebook to run the Jupyter server locally on your machine. It should launch in your browser.
  4. In the Jupyter browser app, navigate to the notebook you'd like to explore.
排名相邻
同类项目

AI Rank iPhone 版

随时追踪 AI 模型榜单

在 App Store 下载