Skip to content

Commit 8622bec

Browse files
committed
Added resources
1 parent eb93412 commit 8622bec

File tree

2 files changed

+34
-7
lines changed

2 files changed

+34
-7
lines changed

episodes/07-bootstrapping.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ from sklearn.linear_model import LogisticRegression
4141
from sklearn.tree import DecisionTreeClassifier
4242
from sklearn.model_selection import train_test_split
4343
from sklearn.utils import resample
44-
from sklearn.metrics import accuracy_score
44+
from sklearn import metrics
4545

4646
# Convert outcome to categorical type
4747
categories = ['ALIVE', 'EXPIRED']
@@ -83,12 +83,12 @@ for i in range(n_iterations):
8383

8484
# Logistic Regression predictions
8585
y_hat_logreg = logreg.predict(X_bs)
86-
score_logreg = accuracy_score(y_bs, y_hat_logreg)
86+
score_logreg = metrics.accuracy_score(y_bs, y_hat_logreg)
8787
accuracy_logreg.append(score_logreg)
8888

8989
# Decision Tree predictions
9090
y_hat_tree = tree.predict(X_bs)
91-
score_tree = accuracy_score(y_bs, y_hat_tree)
91+
score_tree = metrics.accuracy_score(y_bs, y_hat_tree)
9292
accuracy_tree.append(score_tree)
9393
```
9494

@@ -99,8 +99,8 @@ import seaborn as sns
9999
import matplotlib.pyplot as plt
100100

101101
# Plot distribution of bootstrap accuracy for both models
102-
sns.kdeplot(accuracy_logreg, label="Logistic Regression", fill=True, linewidth=2)
103-
sns.kdeplot(accuracy_tree, label="Decision Tree", fill=True linewidth=2)
102+
pd.Series(accuracy_logreg).plot.kde(label="Logistic Regression")
103+
pd.Series(accuracy_tree).plot.kde(label="Decision Tree")
104104

105105
plt.title("Accuracy across 1000 bootstrap samples of the held-out test set")
106106
plt.xlabel("Accuracy")
@@ -153,8 +153,8 @@ Decision Tree: Median accuracy = 0.80, 95% CI = [0.70, 0.89]
153153

154154
```python
155155
# Plot distribution of bootstrap accuracy for both models
156-
sns.kdeplot(accuracy_logreg, label="Logistic Regression", linewidth=2)
157-
sns.kdeplot(accuracy_tree, label="Decision Tree", linewidth=2)
156+
pd.Series(accuracy_logreg).plot.kde(label="Logistic Regression")
157+
pd.Series(accuracy_tree).plot.kde(label="Decision Tree")
158158

159159
# Plot median and confidence intervals for Logistic Regression
160160
plt.axvline(median_logreg, linestyle="--", color="red", label="LogReg Median")

learners/reference.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22
title: 'Resources'
33
---
44

5+
* For questions after the workshop:
6+
- If you have questions about the analysis of the results or the statistics behind
7+
machine learning models, you can reach out to [PSTAT's DataLab](https://datascience.ucsb.edu/consulting)
8+
- For questions about your project or specific questions on your code, you can email
9+
the Library's DREAM Lab [[email protected]](mailto:[email protected])
10+
11+
* Depending on the task of your project, you don't have to spend time training ML models from scratch!
12+
If your project involves text, images, or audio, you'll probably find a model ready to be used on
13+
[Hugging Face](https://huggingface.co/models)
14+
15+
* For continued self-paced learning, we recommend:
16+
- This lesson is [part 1 of 4](https://github.com/carpentries-incubator/machine-learning-novice-python?tab=readme-ov-file#introduction-to-machine-learning-in-python) from a curriculum on The Carpentries Incubator. The other lessons are
17+
- Introduction to Tree Models in Python ([Lesson materials](https://carpentries-incubator.github.io/machine-learning-trees-python/))
18+
- Introduction to artificial neural networks in Python ([Lesson materials](https://carpentries-incubator.github.io/machine-learning-neural-python/))
19+
- Responsible machine learning in Python ([Lesson materials](https://carpentries-incubator.github.io/machine-learning-responsible-python/))
20+
21+
- Google's [Intro to ML concepts](https://developers.google.com/machine-learning/intro-to-ml) and [Crash Course](https://developers.google.com/machine-learning/crash-course)
22+
23+
* Online asynchronous courses we've enjoyed and you can audit for free:
24+
- [StanfordOnline: Statistical Learning with R](https://www.edx.org/learn/statistics/stanford-university-statistical-learning)
25+
- [MITx: Machine Learning with Python: from Linear Models to Deep Learning](https://www.edx.org/learn/data-analysis/massachusetts-institute-of-technology-data-analysis-statistical-modeling-and-computation-in-applications)
26+
27+
* Other Python resources:
28+
- [The Hitchhiker’s Guide to Python](https://docs.python-guide.org/)
29+
- [Scalable and Computationally Reproducible Approaches to Arctic Research](https://learning.nceas.ucsb.edu/2024-03-arctic/)
30+
31+
532
## Glossary
633

734
FIXME

0 commit comments

Comments
 (0)