Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from sklearn.metrics import ( | |
PrecisionRecallDisplay, precision_recall_curve, RocCurveDisplay, roc_curve, | |
ConfusionMatrixDisplay, confusion_matrix | |
) | |
beta = 2 | |
prior_thresh = .50 | |
p1, r1, thresh1 = precision_recall_curve(yactual, ypred1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from sklearn.metrics import ( | |
PrecisionRecallDisplay, precision_recall_curve, RocCurveDisplay, roc_curve | |
) | |
p1, r1, thresh1 = precision_recall_curve(yactual, ypred1) | |
p2, r2, thresh2 = precision_recall_curve(yactual, ypred2) | |
# Determine threshold that maximizes f1 score. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lot_area | bld_type | house_style | exterior | foundation | basement_sqft | central_air | first_floor_sqft | full_bath | kitchen_score | fireplaces | garage_type | garage_nbr_cars | paved_drive | sale_price | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
31770 | 1Fam | 1Story | BrkFace | CBlock | 1080 | Y | 1656 | 1 | TA | 2 | Attchd | 2 | P | 215000 | |
11622 | 1Fam | 1Story | VinylSd | CBlock | 882 | Y | 896 | 1 | TA | 0 | Attchd | 1 | Y | 105000 | |
14267 | 1Fam | 1Story | Wd Sdng | CBlock | 1329 | Y | 1329 | 1 | Gd | 0 | Attchd | 1 | Y | 172000 | |
11160 | 1Fam | 1Story | BrkFace | CBlock | 2110 | Y | 2110 | 2 | Ex | 2 | Attchd | 2 | Y | 244000 | |
13830 | 1Fam | 2Story | VinylSd | PConc | 928 | Y | 928 | 2 | TA | 1 | Attchd | 2 | Y | 189900 | |
9978 | 1Fam | 2Story | VinylSd | PConc | 926 | Y | 926 | 2 | Gd | 1 | Attchd | 2 | Y | 195500 | |
4920 | TwnhsE | 1Story | CemntBd | PConc | 1338 | Y | 1338 | 2 | Gd | 0 | Attchd | 2 | Y | 213500 | |
5005 | TwnhsE | 1Story | HdBoard | PConc | 1280 | Y | 1280 | 2 | Gd | 0 | Attchd | 2 | Y | 191500 | |
5389 | TwnhsE | 1Story | CemntBd | PConc | 1595 | Y | 1616 | 2 | Gd | 1 | Attchd | 2 | Y | 236500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import torch | |
import torchvision | |
from torch.utils.data import Dataset | |
from torchvision import transforms, utils | |
torchvision.disable_beta_transforms_warning() | |
from torchvision.transforms import v2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# ----------------------------------------------------------------------------------- | | |
# Copy configuration files and setup Python on EC2 | | |
# Author: James D. Triveri | | |
# Date: 2022-02 | | |
# | | |
# ./ec2_setup.sh --host=ec2g --send-configs --run-on-ec2 --sync-s3 | | |
# ----------------------------------------------------------------------------------- | |
SETUP_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import folium | |
from folium.plugins import BeautifyIcon, DualMap | |
from folium.features import DivIcon | |
f = folium.Figure(width=800, height=700) | |
m = folium.Map( | |
location=[mid_lat, mid_lon], | |
scrollWheelZoom=True, | |
zoom_start=11, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
See: https://python-visualization.github.io/folium/latest/user_guide/plugins/dual_map.html | |
""" | |
import folium | |
from folium.plugins import BeautifyIcon, DualMap | |
from folium.features import DivIcon | |
tiles = "openstreetmap" # "cartodbpositron" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
team | wins | losses | rank | |
---|---|---|---|---|
Ravens | 13 | 4 | 1 | |
Cowboys | 12 | 5 | 2 | |
Lions | 12 | 5 | 3 | |
49ers | 12 | 5 | 4 | |
Bills | 11 | 6 | 5 | |
Browns | 11 | 6 | 6 | |
Chiefs | 11 | 6 | 7 | |
Dolphins | 11 | 6 | 8 | |
Eagles | 11 | 6 | 9 |