Skip to content

Instantly share code, notes, and snippets.

@galvanic
galvanic / create_numbers_string.py
Last active September 29, 2020 06:55
create_numbers_string.py
#! /bin/env/python3
'''
use:
```bash
$ python3 create_numbers_string.py | pbcopy
```
The second part after the pipe, pipes the stout directly into your clipboard on macOS.
If not on macOS, omit the part after the pipe:
```bash
default_parameters:
experiment: offline training
dataset_filename: trec2007-1607252257
label_type:
ham_label: -1
spam_label: 1
metrics AUC FNR FPR error_test error_train
repetition dataset classifier attack % poisoned
1 trec2007-1607201347 adaline dictionary 0.0 0.96 0.00 0.07 0.03 0.02
0.1 0.50 1.00 0.00 0.66 0.70
0.2 0.50 1.00 0.00 0.67 0.73
0.5 0.50 1.00 0.00 0.66 0.83
empty 0.0 0.96 0.00 0.07 0.02 0.02
0.1 0.96 0.00 0.08 0.03 0.03
default_parameters:
experiment: adaptive combination
dataset_filename: enron-kayla
label_type:
ham_label: -1
spam_label: 1
default_parameters:
experiment: adaptive combination
dataset_filename: enron-kayla
label_type:
ham_label: -1
spam_label: 1
default_parameters:
experiment: adaptive combination
dataset_filename: enron-kayla
label_type:
ham_label: -1
spam_label: 1
default_parameters:
experiment: adaptive combination
dataset_filename: enron-kayla
label_type:
ham_label: -1
spam_label: 1
@galvanic
galvanic / GDmethod.md
Last active August 11, 2016 00:00
test to see Adaline classifier performance depending on gradient descent mini-batch size (here 10) - vs. full batch and stochastic (batch size of 1)
metrics                                                 AUC      FNR      FPR  error_test  error_train
classifier          attack   % poisoned GD method                                                     
adaline             empty    0.0        mini-batch     0.94     0.00     0.12        0.03         0.01
                                        stochastic     0.58     0.65     0.20        0.54         0.51
                                        batch          0.93     0.00     0.14        0.03         0.01
                             0.5        mini-batch     0.92     0.01     0.15        0.04         0.01
                                        stochastic     0.45     0.57     0.53        0.56         0.29
                                        batch          0.90     0.02     0.19        0.06         0.00
@galvanic
galvanic / README.md
Last active July 6, 2016 16:00
upset chart implementation

Upset chart example

A simple upset chart implementation, a chart type useful for visualising set intersections, applied to flatmate-purchase assignment data from my onlineshop project.

See it live on bl.ocks

@galvanic
galvanic / toc.sh
Created June 20, 2016 10:30
command line to get a simple toc (without hyperlinks) for ipython notebook(s) using jq
cat *.ipynb | jq '.cells' | jq -c '.[] | select(.cell_type | contains("markdown"))' | jq -c '. | select(.source[] | contains("#")) | .source[]' | grep "#" | sed 's/"//g' | sed 's/\\n//g' | sed 's/#/\t/g' | sed 's/\(.*\)\t/\1-/'