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
# based on https://www.instructables.com/Portable-Raspberry-Pi-Geiger-Counter-With-Display/ | |
# geiger.py gets data from Mighty Ohm Geiger Counter and writes to a file geiger.dat on Raspberry Pi | |
import time | |
import datetime | |
import string | |
import signal | |
import re | |
import serial | |
import os |
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
### Make some metric validation data | |
# Random predictions (AUC = 0.5) | |
awk -v n_lines=499999 'BEGIN {for (i=0; i<n_lines; i++) {print int(rand()>0.5),rand()}}' > label_pred | |
# Always correct predictions (AUC = 1) | |
awk -v n_lines=499999 'BEGIN {for (i=0; i<n_lines; i++) {label=rand(); print int(label>0.5),label}}' > label_pred | |
# Correct half the time, random and incorrect otherwise (AUC = 0.75) | |
awk -v n_lines=499999 'BEGIN {for (i=0; i<n_lines; i++) {label=rand(); r=rand(); r>0.5 ? pred=label : pred=r; print int(label>0.5),pred}}' > label_pred | |
# model output from file called "predictions" with labels "labels" | |
paste -d' ' labels predictions > label_pred |
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 metaflow import Flow | |
def get_generate_data_run(): | |
return Flow('GenerateData').latest_successful_run | |
def get_train_run(tags: list): | |
print(f'Retrieving run data with tags {tags}') | |
run_list = [ |
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
# Make a directory you can blow away in full later | |
mkdir -p aicamp_demo && cd aicamp_demo | |
# Clone and pin the fwhigh/metaflow-helper git repo | |
git clone https://github.com/fwhigh/metaflow-helper.git | |
cd metaflow-helper | |
git checkout v0.0.1 | |
# Set up and active a virtual environment | |
# Install the metaflow-helper package in editable model and dependencies |
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 | |
mkdir -p data | |
cd data | |
wget https://archive.ics.uci.edu/ml/machine-learning-databases/00380/YouTube-Spam-Collection-v1.zip | |
unzip YouTube-Spam-Collection-v1.zip |
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
data | |
*~ |
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
library(data.table) | |
library(ggplot2) | |
thm <- theme_bw() | |
thm <- thm + theme(axis.line = element_line(colour = "black"), | |
panel.grid.major = element_blank(), | |
panel.grid.minor = element_blank(), | |
panel.border = element_blank(), | |
panel.background = element_blank()) |
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
# http://ryankuhn.net/blog/How-To-Use-Plotly-With-Jekyll | |
devtools::install_github("brendan-R/brocks") |
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 | |
for a in {1..3}; do perf -ROC < kddb.t_eval.subsample.txt > /dev/null; done | |
time for a in {1..10}; do perf -ROC < kddb.t_eval.subsample.txt; done |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder